From 241abdb9d07b22c70219f079981bbfb842ae25ac Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 26 Mar 2015 15:35:14 +0100 Subject: [PATCH] Fix :s behaviour --- lib/ex.coffee | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 4467dbc..874c9f7 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -199,19 +199,14 @@ class Ex throw e buffer = atom.workspace.getActiveTextEditor().buffer - # This adds an entry to the history for each replacement + 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])) ) - # This finds all matches in the buffer, sadly - # buffer.scanInRange(pattern, - # [[range[0], 0], [range[1], buffer.lines[range[1]]].length], - # ({match, matchText, range, stop, replace}) -> - # console.log match, matchText - # ) + buffer.history.groupChangesSinceCheckpoint(cp) s: (args...) => @substitute(args...)