mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
editor.wordRegex is now a config option.
This commit is contained in:
committed by
Corey Johnson
parent
1303e58a87
commit
1d2fa089e5
@@ -9,7 +9,6 @@ class Cursor
|
||||
screenPosition: null
|
||||
bufferPosition: null
|
||||
goalColumn: null
|
||||
wordRegex: /(\w+)|([^\w\n]+)/g
|
||||
visible: true
|
||||
needsAutoscroll: false
|
||||
|
||||
@@ -150,7 +149,7 @@ class Cursor
|
||||
previousLinesRange = [[previousNonBlankRow, 0], currentBufferPosition]
|
||||
|
||||
beginningOfWordPosition = currentBufferPosition
|
||||
@editSession.backwardsScanInRange (options.wordRegex || @wordRegex), previousLinesRange, (match, matchRange, { stop }) =>
|
||||
@editSession.backwardsScanInRange (options.wordRegex ? config.get("editor.wordRegex")), previousLinesRange, (match, matchRange, { stop }) =>
|
||||
if matchRange.end.isGreaterThanOrEqual(currentBufferPosition) or allowPrevious
|
||||
beginningOfWordPosition = matchRange.start
|
||||
stop()
|
||||
@@ -162,7 +161,7 @@ class Cursor
|
||||
range = [currentBufferPosition, @editSession.getEofBufferPosition()]
|
||||
|
||||
endOfWordPosition = null
|
||||
@editSession.scanInRange (options.wordRegex || @wordRegex), range, (match, matchRange, { stop }) =>
|
||||
@editSession.scanInRange (options.wordRegex ? config.get("editor.wordRegex")), range, (match, matchRange, { stop }) =>
|
||||
endOfWordPosition = matchRange.end
|
||||
if not allowNext and matchRange.start.isGreaterThan(currentBufferPosition)
|
||||
endOfWordPosition = currentBufferPosition
|
||||
|
||||
@@ -19,6 +19,7 @@ class Editor extends View
|
||||
autosave: false
|
||||
autoIndent: true
|
||||
autoIndentOnPaste: false
|
||||
wordRegex: /(\w+)|([^\w\n]+)/g
|
||||
|
||||
@content: (params) ->
|
||||
@div class: @classes(params), tabindex: -1, =>
|
||||
|
||||
Reference in New Issue
Block a user