mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
Eliminate 'move-cursor-to-next-word' command
We have move-to-end-of-word and move-to-beginning-of-word, which is what we use for the current keybindings.
This commit is contained in:
@@ -117,9 +117,6 @@ class Cursor
|
||||
moveToEndOfWord: ->
|
||||
@setBufferPosition(@getEndOfCurrentWordBufferPosition())
|
||||
|
||||
moveToNextWord: ->
|
||||
@setBufferPosition(@getBeginningOfNextWordBufferPosition())
|
||||
|
||||
getBeginningOfCurrentWordBufferPosition: (options = {}) ->
|
||||
allowPrevious = options.allowPrevious ? true
|
||||
currentBufferPosition = @getBufferPosition()
|
||||
@@ -146,18 +143,6 @@ class Cursor
|
||||
stop()
|
||||
endOfWordPosition
|
||||
|
||||
getBeginningOfNextWordBufferPosition: ->
|
||||
currentBufferPosition = @getBufferPosition()
|
||||
eofBufferPosition = @editSession.getEofBufferPosition()
|
||||
range = [currentBufferPosition, eofBufferPosition]
|
||||
|
||||
nextWordPosition = eofBufferPosition
|
||||
@editSession.scanInRange @wordRegex, range, (match, matchRange, { stop }) =>
|
||||
if matchRange.start.isGreaterThan(currentBufferPosition)
|
||||
nextWordPosition = matchRange.start
|
||||
stop()
|
||||
nextWordPosition
|
||||
|
||||
getCurrentWordBufferRange: ->
|
||||
new Range(@getBeginningOfCurrentWordBufferPosition(allowPrevious: false), @getEndOfCurrentWordBufferPosition(allowNext: false))
|
||||
|
||||
|
||||
@@ -478,9 +478,6 @@ class EditSession
|
||||
moveCursorToEndOfLine: ->
|
||||
@moveCursors (cursor) -> cursor.moveToEndOfLine()
|
||||
|
||||
moveCursorToNextWord: ->
|
||||
@moveCursors (cursor) -> cursor.moveToNextWord()
|
||||
|
||||
moveCursorToBeginningOfWord: ->
|
||||
@moveCursors (cursor) -> cursor.moveToBeginningOfWord()
|
||||
|
||||
|
||||
@@ -103,7 +103,6 @@ class Editor extends View
|
||||
'core:cut': @cutSelection
|
||||
'core:copy': @copySelection
|
||||
'core:paste': @paste
|
||||
'editor:move-to-next-word': @moveCursorToNextWord
|
||||
'editor:move-to-previous-word': @moveCursorToPreviousWord
|
||||
'editor:select-word': @selectWord
|
||||
'editor:newline': @insertNewline
|
||||
@@ -170,7 +169,6 @@ class Editor extends View
|
||||
moveCursorDown: -> @activeEditSession.moveCursorDown()
|
||||
moveCursorLeft: -> @activeEditSession.moveCursorLeft()
|
||||
moveCursorRight: -> @activeEditSession.moveCursorRight()
|
||||
moveCursorToNextWord: -> @activeEditSession.moveCursorToNextWord()
|
||||
moveCursorToBeginningOfWord: -> @activeEditSession.moveCursorToBeginningOfWord()
|
||||
moveCursorToEndOfWord: -> @activeEditSession.moveCursorToEndOfWord()
|
||||
moveCursorToTop: -> @activeEditSession.moveCursorToTop()
|
||||
|
||||
Reference in New Issue
Block a user