On Sa, 15 Mär 2014, Liang Li wrote: > Hey devs, > > Basically, block visual doesn't work nicely with virtual edit and tabs. > Strange things happen if you try a block visual within a tab. > > Eg: > > vim -u NONE > > fun! Test() > se ve=all > exe "norm! I\<c-i>\<c-i>line1\n" > exe "norm! I\<c-i>\<c-i>line2\n" > exe "norm! I\<c-i>\<c-i>line3\n" > exe "norm! gg07l" |"changing 7 to other values will produce weirdness > too > exe "norm! \<c-v>jjIx\e" > endfun
Good catch. I think, the attached patch fixes it.
Attached is test39.ok also as tar archive, since hg only creates a
binary diff for test39.ok
Best,
Christian
--
Doch der Mensch führt nicht mit dem Menschen Krieg, sondern mit sich
selbst, und gerade aus dem eigenen Inneren fällt uns die feindliche
Schlachtreihe an.
-- Desiderius Erasmus von Rotterdam
(Handbüchlein eines christlichen Streiters)
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -2646,15 +2646,32 @@
if (oap->start.lnum == curbuf->b_op_start.lnum && !bd.is_MAX)
{
if (oap->op_type == OP_INSERT
- && oap->start.col != curbuf->b_op_start.col)
+ && (oap->start.col
+#ifdef FEAT_VIRTUALEDIT
+ + oap->start.coladd
+#endif
+ )
+ != (curbuf->b_op_start.col
+#ifdef FEAT_VIRTUALEDIT
+ + curbuf->b_op_start.coladd)
+#endif
+ )
{
oap->start.col = curbuf->b_op_start.col;
pre_textlen -= getviscol2(oap->start.col, oap->start.coladd)
- oap->start_vcol;
oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd);
}
- else if (oap->op_type == OP_APPEND
- && oap->end.col >= curbuf->b_op_start.col)
+ else if (oap->op_type == OP_APPEND && (oap->end.col
+#ifdef FEAT_VIRTUALEDIT
+ + oap->end.coladd
+#endif
+ )
+ >= (curbuf->b_op_start.col
+#ifdef FEAT_VIRTUALEDIT
+ + curbuf->b_op_start.coladd)
+#endif
+ )
{
oap->start.col = curbuf->b_op_start.col;
/* reset pre_textlen to the value of OP_INSERT */
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -35,6 +35,12 @@
/^C23$/
:exe ":norm! l\<C-V>j$hhAab\<Esc>"
:.,/^$/w >> test.out
+:" Test vor Visual block insert when virtualedit=all
+:set ve=all
+:/\t\tline
+:exe ":norm! 07l\<C-V>jjIx\<Esc>"
+:set ve=
+:.,/^$/w >> test.out
:" gUe must uppercase a whole word, also when ß changes to SS
Gothe youtußeuu endYpk0wgUe
:" gUfx must uppercase until x, inclusive.
@@ -62,6 +68,10 @@
:qa!
ENDTEST
+ line1
+ line2
+ line3
+
aaaaaa
bbbbbb
cccccc
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
index b459355c6ad756d297b58653a563c6c385360202..ef7a2c6442ca8ae973f2ca86e6105214a166180d
GIT binary patch
literal 481
zc$|ez%}&BV5cbL>zQgwdBzCu@zzu8@OpHCyP2{+{-2z(LnAn8+vc8Jb4JtGk=kU#Z
zKQp6`-G{M-E4RD-%WHKY&B7ZOfJ5Dk;A?2QvNwUh+%3Ca;nTfx^0fvS$QT1KkhK<I
zprR-M2BL+K+E5rxVs5k)5@+=O+tel|I=w$)RPAdQ47eC@N%X#R*kmeK>vgIWTwTx@
zUB=W)&n?E3uhR2O`jk)*1XtAM<6?#6fs%}y%1H>(-|w1>l$7#k_tUkle;NoGMiftH
bSEt$Zb`o9SfB74q{6*VT^AJs0&hO|8MNoc-
test39.ok.tar.bz2
Description: Binary data
