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 throw e
buffer = atom.workspace.getActiveTextEditor().buffer buffer = atom.workspace.getActiveTextEditor().buffer
cp = buffer.history.createCheckpoint() atom.workspace.getActiveTextEditor().transact ->
for line in [range[0]..range[1]] for line in [range[0]..range[1]]
buffer.scanInRange(pattern, buffer.scanInRange(pattern,
[[line, 0], [line, buffer.lines[line].length]], [[line, 0], [line, buffer.lines[line].length]],
({match, matchText, range, stop, replace}) -> ({match, matchText, range, stop, replace}) ->
replace(replaceGroups(match[..], spl[1])) replace(replaceGroups(match[..], spl[1]))
) )
buffer.history.groupChangesSinceCheckpoint(cp)
s: (args...) => @substitute(args...) s: (args...) => @substitute(args...)