Patch 9.0.1172
Problem:    When 'selection' is "exclusive" then "1v" is one char short.
Solution:   Add one character when 'selection' is "exclusive. (closes #11791)
Files:      src/normal.c, src/testdir/test_visual.vim


*** ../vim-9.0.1171/src/normal.c        2023-01-01 18:03:55.476613184 +0000
--- src/normal.c        2023-01-10 17:27:53.132527097 +0000
***************
*** 5472,5478 ****
                if (resel_VIsual_line_count <= 1)
                {
                    update_curswant_force();
!                   curwin->w_curswant += resel_VIsual_vcol * cap->count0 - 1;
                }
                else
                    curwin->w_curswant = resel_VIsual_vcol;
--- 5472,5480 ----
                if (resel_VIsual_line_count <= 1)
                {
                    update_curswant_force();
!                   curwin->w_curswant += resel_VIsual_vcol * cap->count0;
!                   if (*p_sel != 'e')
!                       --curwin->w_curswant;
                }
                else
                    curwin->w_curswant = resel_VIsual_vcol;
*** ../vim-9.0.1171/src/testdir/test_visual.vim 2022-11-02 13:30:37.546314580 
+0000
--- src/testdir/test_visual.vim 2023-01-10 17:27:44.324531504 +0000
***************
*** 1336,1341 ****
--- 1336,1353 ----
    bwipe!
  endfunc
  
+ func Test_visual_reselect_exclusive()
+   new
+   call setline(1, ['abcde', 'abcde'])
+   set selection=exclusive
+   normal 1G0viwd
+   normal 2G01vd
+   call assert_equal(['', ''], getline(1, 2))
+ 
+   set selection&
+   bwipe!
+ endfunc
+ 
  func Test_visual_block_insert_round_off()
    new
    " The number of characters are tuned to fill a 4096 byte allocated block,
*** ../vim-9.0.1171/src/version.c       2023-01-10 16:02:41.248313354 +0000
--- src/version.c       2023-01-10 17:19:46.340785053 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1172,
  /**/

-- 
The only way the average employee can speak to an executive is by taking a
second job as a golf caddie.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230110173021.868DF1C0498%40moolenaar.net.

Raspunde prin e-mail lui