[patch] visual block delete with 'breakindent' deleted amount is strange.

61 views
Skip to first unread message

h_east

unread,
Jan 26, 2015, 5:37:49 PM1/26/15
to vim...@googlegroups.com
Hi Bram and Vim developers,

How to reproduce:
---- Pattern#1 ----
:set breakindent
:30vnew
:normal! 3a1234567890
:normal! a abcde
:exec "normal! 0\<C-V>te"
x

Expected behavior:
- displayed "e"

Actual behavior:
- displayed "abcde"

---- Pattern#2 ----
:set breakindent
:30vnew
:normal! 4a1234567890
:exec "normal! >>\<C-V>3f0"
x

Expected behavior:
- displayed "1234567890"

Actual behavior:
- displayed "90"


Investigation result:
The first argument of lbr_chartabsize_ad() should always be the beginning of the line address.
If you do not, Trouble comes into judgment of 'breakindent'.
Yes, it is written in the comments, I think you had maybe noticed :-)

I wrote a patch. Please check this.

Best regards,
Hirohito Higashi (a.k.a h_east)
visual_block_del_with_bri_bugfix.patch

Christian Brabandt

unread,
Jan 27, 2015, 2:02:07 AM1/27/15
to vim...@googlegroups.com, h_east
Oh, I remember there was still a todo item, but I think I had problems
creating a test
case. Can you add a test for that fix as well please?

Best,
Christian

h_east

unread,
Jan 27, 2015, 3:27:57 AM1/27/15
to vim...@googlegroups.com, h.eas...@gmail.com
Hi! Christian,

2015/1/27(Tue) 16:02:07 UTC+9 Christian Brabandt:
OK, I add a test.
I checked successful with my patch + 7.4.591.
And checked fails without my patch.

Thank you.
visual_block_del_with_bri_bugfix2.patch

Bram Moolenaar

unread,
Jan 27, 2015, 7:22:42 AM1/27/15
to h_east, vim...@googlegroups.com
Thanks, I'll include it.

--
~
~
~
".signature" 4 lines, 50 characters written

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages