Merge pull request #59 from jazzpi/use-texteditor-transact

Use TextEditor.transact
This commit is contained in:
Loic Nageleisen 2015-06-28 19:03:49 +02:00
commit 13c5c84688

View file

@ -203,14 +203,13 @@ class Ex
throw e
buffer = atom.workspace.getActiveTextEditor().buffer
cp = buffer.history.createCheckpoint()
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)
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]))
)
s: (args...) => @substitute(args...)