diff options
-rw-r--r-- | src/evalbuffer.c | 3 | ||||
-rw-r--r-- | src/testdir/test_bufline.vim | 17 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c index 13f813ebd8..7de7271770 100644 --- a/src/evalbuffer.c +++ b/src/evalbuffer.c @@ -510,6 +510,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv) tabpage_T *tp; win_T *wp; int did_emsg_before = did_emsg; + int save_VIsual_active = VIsual_active; rettv->vval.v_number = 1; // FAIL by default @@ -538,6 +539,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv) if (!is_curbuf) { + VIsual_active = FALSE; curbuf_save = curbuf; curwin_save = curwin; curbuf = buf; @@ -582,6 +584,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv) { curbuf = curbuf_save; curwin = curwin_save; + VIsual_active = save_VIsual_active; } rettv->vval.v_number = 0; // OK } diff --git a/src/testdir/test_bufline.vim b/src/testdir/test_bufline.vim index d5b5d7ad84..5a062166de 100644 --- a/src/testdir/test_bufline.vim +++ b/src/testdir/test_bufline.vim @@ -238,4 +238,21 @@ func Test_setbufline_select_mode() bwipe! endfunc +func Test_deletebufline_select_mode() + new + call setline(1, ['foo', 'bar']) + call feedkeys("j^v2l\<C-G>", 'nx') + + let bufnr = bufadd('Xdummy') + call bufload(bufnr) + call setbufline(bufnr, 1, ['abc', 'def']) + call deletebufline(bufnr, 1) + + call feedkeys("x", 'nx') + call assert_equal(['foo', 'x'], getline(1, 2)) + + exe "bwipe! " .. bufnr + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index d947125239..6aef8ad539 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5002, +/**/ 5001, /**/ 5000, |