Merge pull request #59 from jazzpi/use-texteditor-transact
Use TextEditor.transact
This commit is contained in:
commit
13c5c84688
1 changed files with 7 additions and 8 deletions
|
|
@ -203,14 +203,13 @@ class Ex
|
|||
throw e
|
||||
|
||||
buffer = atom.workspace.getActiveTextEditor().buffer
|
||||
cp = buffer.history.createCheckpoint()
|
||||
atom.workspace.getActiveTextEditor().transact ->
|
||||
for line in [range[0]..range[1]]
|
||||
buffer.scanInRange(pattern,
|
||||
[[line, 0], [line, buffer.lines[line].length]],
|
||||
({match, matchText, range, stop, replace}) ->
|
||||
replace(replaceGroups(match[..], spl[1]))
|
||||
)
|
||||
buffer.history.groupChangesSinceCheckpoint(cp)
|
||||
|
||||
s: (args...) => @substitute(args...)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue