Patch 8.2.5002
Problem:    deletebufline() may change Visual selection.
Solution:   Disable Visual mode when using another buffer. (closes #10469)
Files:      src/evalbuffer.c, src/testdir/test_bufline.vim


*** ../vim-8.2.5001/src/evalbuffer.c    2022-05-22 11:59:20.527602615 +0100
--- src/evalbuffer.c    2022-05-22 15:33:16.994234776 +0100
***************
*** 510,515 ****
--- 510,516 ----
      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,543 ****
--- 539,545 ----
  
      if (!is_curbuf)
      {
+       VIsual_active = FALSE;
        curbuf_save = curbuf;
        curwin_save = curwin;
        curbuf = buf;
***************
*** 582,587 ****
--- 584,590 ----
      {
        curbuf = curbuf_save;
        curwin = curwin_save;
+       VIsual_active = save_VIsual_active;
      }
      rettv->vval.v_number = 0; // OK
  }
*** ../vim-8.2.5001/src/testdir/test_bufline.vim        2022-05-22 
11:59:20.527602615 +0100
--- src/testdir/test_bufline.vim        2022-05-22 15:33:16.998234772 +0100
***************
*** 238,241 ****
--- 238,258 ----
    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
*** ../vim-8.2.5001/src/version.c       2022-05-22 15:28:27.590322519 +0100
--- src/version.c       2022-05-22 15:35:33.982195876 +0100
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     5002,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
263. You have more e-mail addresses than shorts.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220522143627.04AAE1C06D7%40moolenaar.net.

Raspunde prin e-mail lui