diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index aaffe22d6..c3e0a0591 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -55,6 +55,10 @@ class Cursor isVisible: -> @visible + wordRegExp: -> + nonWordCharacters = config.get("editor.nonWordCharacters") + new RegExp("^[\t ]*$|[^\\s#{_.escapeRegExp(nonWordCharacters)}]+|[#{_.escapeRegExp(nonWordCharacters)}]+", "mg") + isLastCursor: -> this == @editSession.getCursor() @@ -147,10 +151,6 @@ class Cursor if position = @getEndOfCurrentWordBufferPosition() @setBufferPosition(position) - wordRegExp: -> - nonWordCharacters = config.get("editor.nonWordCharacters") - new RegExp("^[\t ]*$|[^\\s#{_.escapeRegExp(nonWordCharacters)}]+|[#{_.escapeRegExp(nonWordCharacters)}]+", "mg") - getBeginningOfCurrentWordBufferPosition: (options = {}) -> allowPrevious = options.allowPrevious ? true currentBufferPosition = @getBufferPosition()