mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Select the replaced text post replacement.
This commit is contained in:
committed by
lexicalunit
parent
82c49001f4
commit
ac7bb27e22
@@ -1328,12 +1328,12 @@ class TextEditor extends Model
|
||||
replaceSelectedText: (options={}, fn) ->
|
||||
{selectWordIfEmpty} = options
|
||||
@mutateSelectedText (selection) ->
|
||||
range = selection.getBufferRange()
|
||||
selection.getBufferRange()
|
||||
if selectWordIfEmpty and selection.isEmpty()
|
||||
selection.selectWord()
|
||||
text = selection.getText()
|
||||
selection.deleteSelectedText()
|
||||
selection.insertText(fn(text))
|
||||
range = selection.insertText(fn(text))
|
||||
selection.setBufferRange(range)
|
||||
|
||||
# Split multi-line selections into one selection per line.
|
||||
|
||||
Reference in New Issue
Block a user