mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
end/beginning word implementations are now more similar
This commit is contained in:
@@ -173,10 +173,9 @@ class Cursor
|
||||
|
||||
endOfWordPosition = null
|
||||
@editSession.scanInRange (options.wordRegex ? @wordRegExp()), range, (match, matchRange, { stop }) =>
|
||||
endOfWordPosition = matchRange.end
|
||||
if matchRange.start.isGreaterThan(currentBufferPosition) and not allowNext
|
||||
endOfWordPosition = currentBufferPosition
|
||||
if not endOfWordPosition.isEqual(currentBufferPosition)
|
||||
if matchRange.start.isLessThanOrEqual(currentBufferPosition) or allowNext
|
||||
endOfWordPosition = matchRange.end
|
||||
if not endOfWordPosition?.isEqual(currentBufferPosition)
|
||||
stop()
|
||||
|
||||
endOfWordPosition or currentBufferPosition
|
||||
|
||||
Reference in New Issue
Block a user