mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
🎨
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user