diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/testdir/test_visual.vim | 15 | ||||
| -rw-r--r-- | src/nvim/undo.c | 4 | 
2 files changed, 19 insertions, 0 deletions
| diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 5fb4934a1d..8520c8e900 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -1162,5 +1162,20 @@ func Test_visual_ex_copy_line()    bwipe!  endfunc +" This was leaving the end of the Visual area beyond the end of a line. +" Set 'undolevels' to start a new undo block. +func Test_visual_undo_deletes_last_line() +  new +  call setline(1, ["aaa", "ccc", "dyd"]) +  set undolevels=100 +  exe "normal obbbbbbbbbxbb\<Esc>" +  set undolevels=100 +  /y +  exe "normal ggvjfxO" +  undo +  normal gNU +  bwipe! +endfunc +  " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/undo.c b/src/nvim/undo.c index d18f35a43a..2d8df4cad8 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2633,6 +2633,10 @@ static void u_undo_end(bool did_undo, bool absolute, bool quiet)      }    } +  if (VIsual_active) { +    check_pos(curbuf, &VIsual); +  } +    smsg_attr_keep(0,                   _("%" PRId64 " %s; %s #%" PRId64 "  %s"),                   u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount, | 
