Patch 9.0.0017
Problem: Accessing memory beyond the end of the line.
Solution: Stop Visual mode when closing a window.
Files: src/window.c, src/testdir/test_visual.vim
*** ../vim-9.0.0016/src/window.c 2022-06-07 10:08:26.000000000 +0100
--- src/window.c 2022-07-01 15:24:59.722468849 +0100
***************
*** 2594,2599 ****
--- 2594,2601 ----
*/
if (wp->w_buffer != curbuf)
{
+ reset_VIsual_and_resel(); // stop Visual mode
+
other_buffer = TRUE;
win->w_closing = TRUE;
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
*** ../vim-9.0.0016/src/testdir/test_visual.vim 2022-05-16 19:34:04.000000000 +0100
--- src/testdir/test_visual.vim 2022-07-01 15:14:34.985298896 +0100
***************
*** 1469,1473 ****
--- 1469,1485 ----
bwipe!
endfunc
+ func Test_visual_area_adjusted_when_hiding()
+ " The Visual area ended after the end of the line after :hide
+ call setline(1, 'xxx')
+ vsplit Xfile
+ call setline(1, 'xxxxxxxx')
+ norm! $o
+ hid
+ norm! zW
+ bwipe!
+ bwipe!
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0016/src/version.c 2022-07-01 13:15:31.556075437 +0100
--- src/version.c 2022-07-01 15:16:01.365542368 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 17,
/**/
--
My sister Cecilia opened a computer store in Hawaii.
She sells C shells by the seashore.
/// 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 ///