Add getWordUnderCursor to Editor and EditSession

This commit is contained in:
Corey Johnson
2013-01-21 15:19:01 -08:00
parent ad8a29df80
commit 32e281bcc6
3 changed files with 7 additions and 4 deletions

View File

@@ -498,6 +498,9 @@ class EditSession
getCurrentParagraphBufferRange: ->
@getCursor().getCurrentParagraphBufferRange()
getWordUnderCursor: (options) ->
@getTextInBufferRange(@getCursor().getCurrentWordBufferRange(options))
moveCursorUp: (lineCount) ->
@moveCursors (cursor) -> cursor.moveUp(lineCount)

View File

@@ -209,6 +209,7 @@ class Editor extends View
setCursorBufferPosition: (position, options) -> @activeEditSession.setCursorBufferPosition(position, options)
getCursorBufferPosition: -> @activeEditSession.getCursorBufferPosition()
getCurrentParagraphBufferRange: -> @activeEditSession.getCurrentParagraphBufferRange()
getWordUnderCursor: (options) -> @activeEditSession.getWordUnderCursor(options)
getSelection: (index) -> @activeEditSession.getSelection(index)
getSelections: -> @activeEditSession.getSelections()