Hi! Christian,
2015/1/27(Tue) 16:02:07 UTC+9 Christian Brabandt:
> Am 2015-01-26 23:37, schrieb h_east:
> > 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.
>
> 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?
OK, I add a test.
I checked successful with my patch + 7.4.591.
And checked fails without my patch.
Thank you.
Best regards,
Hirohito Higashi (a.k.a h_east)
--
--
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 -r 435956324539 src/ops.c
--- a/src/ops.c Sun Jan 25 13:02:57 2015 +0100
+++ b/src/ops.c Tue Jan 27 17:11:57 2015 +0900
@@ -5308,10 +5308,7 @@
{
/* Count a tab for what it's worth (if list mode not on) */
prev_pend = pend;
- /* TODO: is passing prev_pend for start of the line OK?
- * perhaps it should be "line". */
- incr = lbr_chartabsize_adv(prev_pend, &pend,
- (colnr_T)bdp->end_vcol);
+ incr = lbr_chartabsize_adv(line, &pend, (colnr_T)bdp->end_vcol);
bdp->end_vcol += incr;
}
if (bdp->end_vcol <= oap->end_vcol
diff -r 435956324539 src/testdir/test_breakindent.in
--- a/src/testdir/test_breakindent.in Sun Jan 25 13:02:57 2015 +0100
+++ b/src/testdir/test_breakindent.in Tue Jan 27 17:11:57 2015 +0900
@@ -99,6 +99,23 @@
:$put =line1
:$put =line2
:"
+:let g:test="Test 14: breakindent + visual blockwise delete #1"
+:set all& breakindent
+:30vnew
+:normal! 3a1234567890
+:normal! a abcde
+:exec "normal! 0\<C-V>tex"
+:let line1=ScreenChar(line('.'),8)
+:call DoRecordScreen()
+:"
+:let g:test="Test 15: breakindent + visual blockwise delete #2"
+:%d
+:normal! 4a1234567890
+:exec "normal! >>\<C-V>3f0x"
+:let line1=ScreenChar(line('.'),20)
+:call DoRecordScreen()
+:quit!
+:"
:%w! test.out
:qa!
ENDTEST
diff -r 435956324539 src/testdir/test_breakindent.ok
--- a/src/testdir/test_breakindent.ok Sun Jan 25 13:02:57 2015 +0100
+++ b/src/testdir/test_breakindent.ok Tue Jan 27 17:11:57 2015 +0900
@@ -62,3 +62,13 @@
Test 13: breakindent with wrapping Tab
d
w
+
+Test 14: breakindent + visual blockwise delete #1
+e
+~
+~
+
+Test 15: breakindent + visual blockwise delete #2
+ 1234567890
+~
+~