Apply filter option to substrings in blockwise-visual mode

This commit is contained in:
Junegunn Choi
2015-09-16 03:08:08 +09:00
parent 1206c65dcb
commit 98e0b493ac
2 changed files with 25 additions and 2 deletions

View File

@@ -358,9 +358,10 @@ function! s:do_align(todo, modes, all_tokens, all_delims, fl, ll, fc, lc, nth, r
" Phase 1 " Phase 1
for line in range(a:fl, a:ll) for line in range(a:fl, a:ll)
if f == 1 && getline(line) !~ fx let snip = a:lc > 0 ? getline(line)[a:fc-1 : a:lc-1] : getline(line)
if f == 1 && snip !~ fx
continue continue
elseif f == -1 && getline(line) =~ fx elseif f == -1 && snip =~ fx
continue continue
endif endif

View File

@@ -1535,6 +1535,28 @@ Expect:
bbbbb=bbbbb=bbbbb bbbbb=bbbbb=bbbbb
aaa = aaa = aaa aaa = aaa = aaa
Given clojure (filter with blockwise-visual mode):
(let [a 1
bbb 2
ccccc (range
10 20)]
(prn [a bbb ccccc]))
Do (filter with blockwise-visual mode):
f[
vi[
\<C-V>
\<Enter>
\<C-F>g/^\S\<Enter>
\<Space>
Expect clojure:
(let [a 1
bbb 2
ccccc (range
10 20)]
(prn [a bbb ccccc]))
########################################################### ###########################################################
Given (hard-tab indentation (#19)): Given (hard-tab indentation (#19)):