diff options
author | Bram Moolenaar <bram@vim.org> | 2015-01-27 13:22:20 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2015-01-27 13:22:20 +0100 |
commit | 9e0b1d8ec0d75b11282c9e7520bbfc7807d50805 (patch) | |
tree | 012b8857512dc2813ad3347aa7326ab62001b1f5 | |
parent | 8dc4ae465395698e1d8e4bc99e2d22ca93802965 (diff) | |
download | vim-9e0b1d8ec0d75b11282c9e7520bbfc7807d50805.tar.gz |
Problem: Using a block delete while 'breakindent' is set does not work
properly.
Solution: Use "line" instead of "prev_pend" as the first argument to
lbr_chartabsize_adv(). (Hirohito Higashi)
-rw-r--r-- | src/ops.c | 5 | ||||
-rw-r--r-- | src/testdir/test_breakindent.in | 17 | ||||
-rw-r--r-- | src/testdir/test_breakindent.ok | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 30 insertions, 4 deletions
@@ -5308,10 +5308,7 @@ block_prep(oap, bdp, lnum, is_del) { /* 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 --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in index a255457b..f9d903e5 100644 --- a/src/testdir/test_breakindent.in +++ b/src/testdir/test_breakindent.in @@ -99,6 +99,23 @@ fygjyl:let line2 = @0 :$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 --git a/src/testdir/test_breakindent.ok b/src/testdir/test_breakindent.ok index e50265ec..3eb9c24f 100644 --- a/src/testdir/test_breakindent.ok +++ b/src/testdir/test_breakindent.ok @@ -62,3 +62,13 @@ strdisplaywidth: 46 == calculated: 64 Test 13: breakindent with wrapping Tab d w + +Test 14: breakindent + visual blockwise delete #1 +e +~ +~ + +Test 15: breakindent + visual blockwise delete #2 + 1234567890 +~ +~ diff --git a/src/version.c b/src/version.c index 6a40cfa3..9ae697e4 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 594, +/**/ 593, /**/ 592, |