mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Anchor.setBufferPosition clips position by default
This commit is contained in:
@@ -100,7 +100,7 @@ class Cursor
|
||||
@setBufferPosition(newPosition)
|
||||
|
||||
moveToEndOfLine: ->
|
||||
@setBufferPosition([@getCurrentBufferRow(), Infinity], clip: true)
|
||||
@setBufferPosition([@getCurrentBufferRow(), Infinity])
|
||||
|
||||
moveToBeginningOfWord: ->
|
||||
@setBufferPosition(@getBeginningOfCurrentWordBufferPosition())
|
||||
|
||||
@@ -27,11 +27,9 @@ class Anchor
|
||||
@bufferPosition
|
||||
|
||||
setBufferPosition: (position, options={}) ->
|
||||
if options.clip
|
||||
@bufferPosition = @editSession.clipBufferPosition(position)
|
||||
else
|
||||
@bufferPosition = Point.fromObject(position)
|
||||
|
||||
@bufferPosition = Point.fromObject(position)
|
||||
clip = options.clip ? true
|
||||
@bufferPosition = @editSession.clipBufferPosition(@bufferPosition) if clip
|
||||
@refreshScreenPosition(options)
|
||||
|
||||
getScreenPosition: ->
|
||||
|
||||
@@ -10,7 +10,7 @@ class CompositeCommand
|
||||
currentRanges = editor.getSelectionsOrderedByBufferPosition().map (selection) -> selection.getBufferRange()
|
||||
for currentRange in currentRanges
|
||||
newRanges.push(command.execute(editor, currentRange)...)
|
||||
editor.setSelectedBufferRanges(newRanges, clip: true)
|
||||
editor.setSelectedBufferRanges(newRanges)
|
||||
|
||||
isRelativeAddress: ->
|
||||
_.all(@subcommands, (command) -> command.isAddress() and command.isRelative())
|
||||
|
||||
Reference in New Issue
Block a user