mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Only create EditorComponent once per editor
This commit is contained in:
committed by
Antonio Scandurra
parent
ebad2e6605
commit
f00941f299
@@ -3547,9 +3547,12 @@ class TextEditor extends Model
|
||||
|
||||
# Get the Element for the editor.
|
||||
getElement: ->
|
||||
TextEditorComponent ?= require('./text-editor-component')
|
||||
new TextEditorComponent({model: this})
|
||||
@component.element
|
||||
if @component?
|
||||
@component.element
|
||||
else
|
||||
TextEditorComponent ?= require('./text-editor-component')
|
||||
new TextEditorComponent({model: this})
|
||||
@component.element
|
||||
|
||||
# Essential: Retrieves the greyed out placeholder of a mini editor.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user