Patch 9.0.1172

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 10, 2023, 12:30:28 PM1/10/23
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages