Patch 8.2.3494
Problem: Illegal memory access in utf_head_off.
Solution: Check cursor position when reselecting the Visual area.
(closes #8963)
Files: src/normal.c, src/testdir/test_visual.vim
*** ../vim-8.2.3493/src/normal.c 2021-09-12 12:39:04.323467415 +0100
--- src/normal.c 2021-10-11 15:38:10.609650473 +0100
***************
*** 5671,5678 ****
{
curwin->w_cursor.lnum +=
resel_VIsual_line_count * cap->count0 - 1;
! if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
! curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
}
VIsual_mode = resel_VIsual_mode;
if (VIsual_mode == 'v')
--- 5671,5677 ----
{
curwin->w_cursor.lnum +=
resel_VIsual_line_count * cap->count0 - 1;
! check_cursor();
}
VIsual_mode = resel_VIsual_mode;
if (VIsual_mode == 'v')
*** ../vim-8.2.3493/src/testdir/test_visual.vim 2021-07-04 11:30:00.215304320
+0100
--- src/testdir/test_visual.vim 2021-10-11 15:36:03.998999040 +0100
***************
*** 1265,1269 ****
--- 1265,1289 ----
call delete('XTest_block')
endfunc
+ func Test_visual_reselect_with_count()
+ " this was causing an illegal memory access
+ let lines =<< trim END
+
+
+
+ :
+ r<sfile>
+ exe "%norm e3\<c-v>kr\t"
+ :
+
+ :
+ END
+ call writefile(lines, 'XvisualReselect')
+ source XvisualReselect
+
+ bwipe!
+ call delete('XvisualReselect')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3493/src/version.c 2021-10-10 13:53:55.345494414 +0100
--- src/version.c 2021-10-11 15:39:27.987201847 +0100
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3494,
/**/
--
hundred-and-one symptoms of being an internet addict:
131. You challenge authority and society by portnuking people
/// 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/20211011144132.E2B30C80053%40moolenaar.net.