Anchor.setBufferPosition clips position by default

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-12 16:44:34 -07:00
parent 6c8b2e1a54
commit feb0c6af85
3 changed files with 5 additions and 7 deletions

View File

@@ -100,7 +100,7 @@ class Cursor
@setBufferPosition(newPosition)
moveToEndOfLine: ->
@setBufferPosition([@getCurrentBufferRow(), Infinity], clip: true)
@setBufferPosition([@getCurrentBufferRow(), Infinity])
moveToBeginningOfWord: ->
@setBufferPosition(@getBeginningOfCurrentWordBufferPosition())

View File

@@ -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: ->

View File

@@ -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())