Fix #40: Spurious undo in live interactive mode

Problem identified and patch provided by @wilywampa
This commit is contained in:
Junegunn Choi
2014-10-03 11:25:51 +09:00
parent 21697776b4
commit 6bc221c285
3 changed files with 17 additions and 2 deletions

View File

@@ -640,7 +640,8 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, live, bvis)
let output = s:process(a:range, mode, n, d, s:normalize_options(opts), regx, a:rules, a:bvis) let output = s:process(a:range, mode, n, d, s:normalize_options(opts), regx, a:rules, a:bvis)
let &undolevels = &undolevels " Break undo block let &undolevels = &undolevels " Break undo block
call s:update_lines(output.todo) call s:update_lines(output.todo)
let undo = 1 let undo = !empty(output.todo)
let undo = !empty(output.todo)
let rdrw = 1 let rdrw = 1
endif endif
if rdrw if rdrw

View File

@@ -161,4 +161,17 @@ Expect:
d, e, f d, e, f
Given c (#40 Ignored delimiters in LiveEasyAlign causes spurious undo):
printf("foo = %f\n", foo);
printf("foobar = %f\n", foobar);
Do:
gUiw
:%LiveEasyAlign\<enter>
=\<bs>==
Expect c:
PRINTF("foo = %f\n", foo);
printf("foobar = %f\n", foobar);
Include: include/teardown.vader Include: include/teardown.vader

View File

@@ -1,3 +1,4 @@
Execute: Given:
Execute (Restoring test environment):
Restore Restore