diff options
author | David Bürgin <676c7473@gmail.com> | 2015-05-14 15:25:56 +0200 |
---|---|---|
committer | Michael Reed <m.reed@mykolab.com> | 2015-05-16 18:39:39 -0400 |
commit | f52528477886556e4fc0fa80b6a9d0b8d08cfd9d (patch) | |
tree | 1bdbe36bc4ef9b5299c885736edb9a551594e75e | |
parent | 9b87955b34cca3b2a9708b073e07f3641198e7a0 (diff) | |
download | rneovim-f52528477886556e4fc0fa80b6a9d0b8d08cfd9d.tar.gz rneovim-f52528477886556e4fc0fa80b6a9d0b8d08cfd9d.tar.bz2 rneovim-f52528477886556e4fc0fa80b6a9d0b8d08cfd9d.zip |
vim-patch:7.4.594 #2654
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)
https://github.com/vim/vim/commit/v7-4-594
See https://groups.google.com/d/msg/vim_dev/B8k0AVlqMUU/qKXeY8srpGcJ
-rw-r--r-- | src/nvim/ops.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_breakindent.in | 17 | ||||
-rw-r--r-- | src/nvim/testdir/test_breakindent.ok | 10 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 29 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 2cbf74ac90..dfc41d5685 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -4149,9 +4149,7 @@ static void block_prep(oparg_T *oap, struct block_def *bdp, linenr_T lnum, int i while (bdp->end_vcol <= oap->end_vcol && *pend != NUL) { /* 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? - // prehaps 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/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in index 4242e6c266..5c6ec4d927 100644 --- a/src/nvim/testdir/test_breakindent.in +++ b/src/nvim/testdir/test_breakindent.in @@ -100,6 +100,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/nvim/testdir/test_breakindent.ok b/src/nvim/testdir/test_breakindent.ok index 0b16dfce0e..995bd5f29c 100644 --- a/src/nvim/testdir/test_breakindent.ok +++ b/src/nvim/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/nvim/version.c b/src/nvim/version.c index c8aa4ba0af..4d69b9dee9 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -189,7 +189,7 @@ static int included_patches[] = { //597, //596 NA 595, - //594, + 594, //593, //592 NA //591 NA |