mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-11 11:23:49 -05:00
Fix #40: Spurious undo in live interactive mode
Problem identified and patch provided by @wilywampa
This commit is contained in:
@@ -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 &undolevels = &undolevels " Break undo block
|
||||
call s:update_lines(output.todo)
|
||||
let undo = 1
|
||||
let undo = !empty(output.todo)
|
||||
let undo = !empty(output.todo)
|
||||
let rdrw = 1
|
||||
endif
|
||||
if rdrw
|
||||
|
||||
@@ -161,4 +161,17 @@ Expect:
|
||||
|
||||
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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
Execute:
|
||||
Given:
|
||||
Execute (Restoring test environment):
|
||||
Restore
|
||||
|
||||
|
||||
Reference in New Issue
Block a user