diff --git a/spec/app/edit-session-spec.coffee b/spec/app/edit-session-spec.coffee index 292eb28d9..afda0980c 100644 --- a/spec/app/edit-session-spec.coffee +++ b/spec/app/edit-session-spec.coffee @@ -252,21 +252,6 @@ describe "EditSession", -> editSession.setCursorBufferPosition([10, 0]) editSession.moveCursorToFirstCharacterOfLine() - describe ".moveCursorToNextWord()", -> - it "moves the cursor to the next word or the end of file if there is no next word", -> - editSession.setCursorBufferPosition [2, 5] - editSession.addCursorAtBufferPosition [3, 60] - [cursor1, cursor2] = editSession.getCursors() - - editSession.moveCursorToNextWord() - expect(cursor1.getBufferPosition()).toEqual [2, 7] - expect(cursor2.getBufferPosition()).toEqual [4, 4] - - buffer.insert([12, 2], ' ') - cursor1.setBufferPosition([12, 1]) - editSession.moveCursorToNextWord() - expect(cursor1.getBufferPosition()).toEqual [12, 5] - describe ".moveCursorToBeginningOfWord()", -> it "moves the cursor to the beginning of the word", -> editSession.setCursorBufferPosition [0, 8] diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index 4f4c91312..d354b4e0e 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -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)) diff --git a/src/app/edit-session.coffee b/src/app/edit-session.coffee index 411afd421..50e6231cb 100644 --- a/src/app/edit-session.coffee +++ b/src/app/edit-session.coffee @@ -478,9 +478,6 @@ class EditSession moveCursorToEndOfLine: -> @moveCursors (cursor) -> cursor.moveToEndOfLine() - moveCursorToNextWord: -> - @moveCursors (cursor) -> cursor.moveToNextWord() - moveCursorToBeginningOfWord: -> @moveCursors (cursor) -> cursor.moveToBeginningOfWord() diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 3157bc2b0..122e0fde0 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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()