mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-09 10:23:49 -05:00
Use virtcol in blockwise visual mode
This commit is contained in:
@@ -1050,12 +1050,15 @@ function! s:process(range, mode, n, ch, opts, regexp, rules, bvis)
|
|||||||
\ get(dict, 'align', recur == 2 ? s:alternating_modes(a:mode) : a:mode),
|
\ get(dict, 'align', recur == 2 ? s:alternating_modes(a:mode) : a:mode),
|
||||||
\ recur)
|
\ recur)
|
||||||
|
|
||||||
|
let ve = &virtualedit
|
||||||
|
set ve=all
|
||||||
let args = [
|
let args = [
|
||||||
\ {}, split(mode_sequence, '\zs'),
|
\ {}, split(mode_sequence, '\zs'),
|
||||||
\ {}, {}, a:range[0], a:range[1],
|
\ {}, {}, a:range[0], a:range[1],
|
||||||
\ a:bvis ? min([col("'<"), col("'>")]) : 1,
|
\ a:bvis ? min([virtcol("'<"), virtcol("'>")]) : 1,
|
||||||
\ (!recur && a:bvis) ? max([col("'<"), col("'>")]) : 0,
|
\ (!recur && a:bvis) ? max([virtcol("'<"), virtcol("'>")]) : 0,
|
||||||
\ nth, recur, dict ]
|
\ nth, recur, dict ]
|
||||||
|
let &ve = ve
|
||||||
while len(args) > 1
|
while len(args) > 1
|
||||||
let args = call('s:do_align', args)
|
let args = call('s:do_align', args)
|
||||||
endwhile
|
endwhile
|
||||||
|
|||||||
@@ -1557,6 +1557,41 @@ Expect clojure:
|
|||||||
10 20)]
|
10 20)]
|
||||||
(prn [a bbb ccccc]))
|
(prn [a bbb ccccc]))
|
||||||
|
|
||||||
|
Given clojure:
|
||||||
|
{:user {:plugins [[cider/cider-nrepl "0.9.1"]
|
||||||
|
[lein-kibit "0.0.8"]
|
||||||
|
[lein-licenses "0.1.1"]
|
||||||
|
[lein-marginalia "0.8.0"] ; lein marg
|
||||||
|
[codox "0.8.13"] ; lein doc
|
||||||
|
[com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh
|
||||||
|
[lein-pprint "1.1.2"]
|
||||||
|
[lein-exec "0.3.5"]
|
||||||
|
[jonase/eastwood "0.2.1"]]
|
||||||
|
:dependencies [[slamhound "1.5.5"]]
|
||||||
|
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
|
||||||
|
:signing {:gpg-key "FEF9C627"}}}
|
||||||
|
|
||||||
|
Do (Virtual column should be used in blockwise-visual mode):
|
||||||
|
f[
|
||||||
|
vi[
|
||||||
|
\<C-V>
|
||||||
|
$20l
|
||||||
|
\<Enter>\<Space>
|
||||||
|
|
||||||
|
Expect clojure:
|
||||||
|
{:user {:plugins [[cider/cider-nrepl "0.9.1"]
|
||||||
|
[lein-kibit "0.0.8"]
|
||||||
|
[lein-licenses "0.1.1"]
|
||||||
|
[lein-marginalia "0.8.0"] ; lein marg
|
||||||
|
[codox "0.8.13"] ; lein doc
|
||||||
|
[com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh
|
||||||
|
[lein-pprint "1.1.2"]
|
||||||
|
[lein-exec "0.3.5"]
|
||||||
|
[jonase/eastwood "0.2.1"]]
|
||||||
|
:dependencies [[slamhound "1.5.5"]]
|
||||||
|
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
|
||||||
|
:signing {:gpg-key "FEF9C627"}}}
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
Given (hard-tab indentation (#19)):
|
Given (hard-tab indentation (#19)):
|
||||||
|
|||||||
Reference in New Issue
Block a user