mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Add getWordUnderCursor to Editor and EditSession
This commit is contained in:
@@ -498,6 +498,9 @@ class EditSession
|
||||
getCurrentParagraphBufferRange: ->
|
||||
@getCursor().getCurrentParagraphBufferRange()
|
||||
|
||||
getWordUnderCursor: (options) ->
|
||||
@getTextInBufferRange(@getCursor().getCurrentWordBufferRange(options))
|
||||
|
||||
moveCursorUp: (lineCount) ->
|
||||
@moveCursors (cursor) -> cursor.moveUp(lineCount)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user