Revert "Make user confirm regular expression on live interactive mode"

This reverts commit a76cfdb8ae.
This commit is contained in:
Junegunn Choi
2013-10-25 02:17:52 +09:00
parent a76cfdb8ae
commit 1a232ac19b
4 changed files with 13 additions and 13 deletions

View File

@@ -183,9 +183,9 @@ in addition to the one for `:EasyAlign` command.
vnoremap <silent> <Leader><Enter> :LiveEasyAlign<Enter> vnoremap <silent> <Leader><Enter> :LiveEasyAlign<Enter>
``` ```
In live interactive mode, you have to type in the same delimiter or regular In live interactive mode, you have to type in the same delimiter (or `CTRL-X` on
expression again to finalize the alignment. This allows you to preview the regular expression) again to finalize the alignment. This allows you to preview
result of the alignment and freely change the delimiter using backspace key the result of the alignment and freely change the delimiter using backspace key
without leaving the interactive mode. without leaving the interactive mode.
### Using `EasyAlign` in command line ### Using `EasyAlign` in command line

View File

@@ -690,16 +690,16 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, live)
silent! call remove(opts, 'm') silent! call remove(opts, 'm')
endif endif
elseif ch == "\<C-_>" || ch == "\<C-X>" elseif ch == "\<C-_>" || ch == "\<C-X>"
let pd = regx ? d : '' if a:live && regx && !empty(d)
break
endif
let prompt = 'Regular expression: ' let prompt = 'Regular expression: '
let ch = s:input(prompt, pd, a:vis) let ch = s:input(prompt, '', a:vis)
if !empty(ch) && s:valid_regexp(ch) if !empty(ch) && s:valid_regexp(ch)
let regx = 1 let regx = 1
let d = ch let d = ch
if !a:live || pd == d if !a:live | break | endif
break
endif
else else
let warn = 'Invalid regular expression: '.ch let warn = 'Invalid regular expression: '.ch
endif endif

View File

@@ -121,10 +121,10 @@ following mapping in addition to the one for `:EasyAlign` command.
vnoremap <silent> <Leader><Enter> :LiveEasyAlign<Enter> vnoremap <silent> <Leader><Enter> :LiveEasyAlign<Enter>
In live interactive mode, you have to type in the same delimiter or In live interactive mode, you have to type in the same delimiter (or
regular expression again to finalize the alignment. This allows you to `CTRL-X` on regular expression) again to finalize the alignment. This
preview the result of the alignment and freely change the delimiter using allows you to preview the result of the alignment and freely change the
backspace key without leaving the interactive mode. delimiter using backspace key without leaving the interactive mode.
Left/right/center mode switch in interactive mode Left/right/center mode switch in interactive mode

View File

@@ -508,7 +508,7 @@ Do (live interactive mode!):
\<C-I>\<C-I> \<C-I>\<C-I>
\<C-X>|\<Enter> \<C-X>|\<Enter>
\<Enter> \<Enter>
\<C-X>\<Enter> \<C-X>
Expect: Expect:
[|] Option[|]Type [|]Default[|]Description [| [|] Option[|]Type [|]Default[|]Description [|