Retain cursor position after <Plug>(EasyAlign) in visual mode

This commit is contained in:
Junegunn Choi
2014-11-30 02:01:52 +09:00
parent b8abc366a6
commit aa1ba68ea0
2 changed files with 15 additions and 1 deletions

View File

@@ -778,6 +778,9 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, bvis)
if has_key(a:rules, ch)
let d = ch
if !s:live
if a:vis
execute "normal! gv\<esc>"
endif
break
endif
else

View File

@@ -19,6 +19,17 @@ Expect:
111 22 333 444 55555 6666 7 88888
1111 2 33 444 555 66 777 8
Do (left-align / cursor position retained):
vGww
\<Enter>
*\<Space>D
Expect:
1 22222 33 444 555 6666 7 888
11 222 3333 4 55 6666 77 888
111 22 333 444 55555 6666 7 88888
1111 2
Do (left-align using operator map):
\<Space>Aip*\<Space>
@@ -1663,7 +1674,7 @@ Do (Blockwise-visual-operator is also repeatable):
f1
4j
\<Enter>:
7G
7G0
fa
.