Patch 8.2.3088

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 3, 2021, 9:09:20 AM7/3/21
to vim...@googlegroups.com

Patch 8.2.3088
Problem: With 'virtualedit' set to "block" Visual highlight is wrong after
using "$". (Marco Trosi)
Solution: Do not set w_old_cursor_lcol to MAXCOL. (closes #8495)
Files: src/drawscreen.c, src/testdir/test_visual.vim,
src/testdir/dumps/Test_visual_block_with_virtualedit.dump


*** ../vim-8.2.3087/src/drawscreen.c 2021-04-23 21:01:30.649469081 +0200
--- src/drawscreen.c 2021-07-03 15:06:28.841407365 +0200
***************
*** 2007,2013 ****
ve_flags = save_ve_flags;
#endif
++toc;
! if (curwin->w_curswant == MAXCOL)
toc = MAXCOL;

if (fromc != wp->w_old_cursor_fcol
--- 2007,2015 ----
ve_flags = save_ve_flags;
#endif
++toc;
! // Highlight to the end of the line, unless 'virtualedit' has
! // "block".
! if (curwin->w_curswant == MAXCOL && !(ve_flags & VE_BLOCK))
toc = MAXCOL;

if (fromc != wp->w_old_cursor_fcol
*** ../vim-8.2.3087/src/testdir/test_visual.vim 2021-06-29 18:54:32.284672333 +0200
--- src/testdir/test_visual.vim 2021-07-03 15:03:44.813722558 +0200
***************
*** 2,7 ****
--- 2,8 ----

source shared.vim
source check.vim
+ source screendump.vim

func Test_block_shift_multibyte()
" Uses double-wide character.
***************
*** 1241,1245 ****
--- 1242,1266 ----
bw!
endfunc

+ func Test_visual_block_with_virtualedit()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, ['aaaaaa', 'bbbb', 'cc'])
+ set virtualedit=block
+ normal G
+ END
+ call writefile(lines, 'XTest_block')
+
+ let buf = RunVimInTerminal('-S XTest_block', {'rows': 8, 'cols': 50})
+ call term_sendkeys(buf, "\<C-V>gg$")
+ call VerifyScreenDump(buf, 'Test_visual_block_with_virtualedit', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+ call delete('XTest_beval')
+ endfunc
+

" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3087/src/testdir/dumps/Test_visual_block_with_virtualedit.dump 2021-07-03 15:08:08.617215728 +0200
--- src/testdir/dumps/Test_visual_block_with_virtualedit.dump 2021-07-03 15:03:56.513700061 +0200
***************
*** 0 ****
--- 1,8 ----
+ |a+0&#e0e0e08@5> +0&#ffffff0@43
+ |b+0&#e0e0e08@3| @2| +0&#ffffff0@42
+ |c+0&#e0e0e08@1| @4| +0&#ffffff0@42
+ |~+0#4040ff13&| @48
+ |~| @48
+ |~| @48
+ |~| @48
+ |-+2#0000000&@1| |V|I|S|U|A|L| |B|L|O|C|K| |-@1| +0&&@3|3|x|7| @6|1|,|7| @10|A|l@1|
*** ../vim-8.2.3087/src/version.c 2021-07-03 13:51:40.525896631 +0200
--- src/version.c 2021-07-03 14:58:04.662378405 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3088,
/**/

--
ASCII stupid question, get a stupid ANSI.

/// 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