From 7c202faefa90e6a1acedc658597a440f3d6ce3e9 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 18 Jun 2015 18:49:37 +0200 Subject: [PATCH] Use TextEditor.transact This fixes #57 and atom/atom#703 --- lib/ex.coffee | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 21f5037..3231748 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -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...)