This commit is contained in:
Machiste Quintana
2015-05-03 23:43:19 -04:00
parent aabde38f61
commit e269b3bad9

View File

@@ -943,10 +943,9 @@ class TextEditor extends Model
charToLeftOfSelection = new Range(selection.start.translate(translationDelta), selection.start)
unless charToLeftOfSelection.start.column < 0
insertionPoint = selection.end
text = @buffer.getTextInRange(charToLeftOfSelection)
@buffer.insert(insertionPoint, text)
@buffer.insert(selection.end, text)
@buffer.delete(charToLeftOfSelection)
translatedRanges.push(selection.translate(translationDelta))
@@ -963,11 +962,10 @@ class TextEditor extends Model
charToRightOfSelection = new Range(selection.end, selection.end.translate(translationDelta))
unless charToRightOfSelection.end.column > @buffer.lineLengthForRow(charToRightOfSelection.end.row)
insertionPoint = selection.start
text = @buffer.getTextInRange(charToRightOfSelection)
@buffer.delete(charToRightOfSelection)
@buffer.insert(insertionPoint, text)
@buffer.insert(selection.start, text)
translatedRanges.push(selection.translate(translationDelta))
@setSelectedBufferRanges(translatedRanges) if translatedRanges.length > 0