mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Add commonly used Editor methods to Editor View
Mini-editors use these methods very often, but really we shouldn't need to do this.
This commit is contained in:
@@ -220,6 +220,18 @@ class EditorView extends View
|
||||
getEditor: ->
|
||||
@editor
|
||||
|
||||
# {Delegates to: Editor.getText}
|
||||
getText: ->
|
||||
@editor.getText()
|
||||
|
||||
# {Delegates to: Editor.setText}
|
||||
setText: (text) ->
|
||||
@editor.setText(text)
|
||||
|
||||
# {Delegates to: Editor.insertText}
|
||||
insertText: (text, options) ->
|
||||
@editor.insertText(text, options)
|
||||
|
||||
# Private:
|
||||
setHeightInLines: (heightInLines)->
|
||||
heightInLines ?= @calculateHeightInLines()
|
||||
|
||||
Reference in New Issue
Block a user