mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-13 12:23:48 -05:00
Apply filter option to substrings in blockwise-visual mode
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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)):
|
||||||
|
|||||||
Reference in New Issue
Block a user