ve_flags = save_ve_flags;
#endif
++toc;
- if (curwin->w_curswant == MAXCOL)
+ // 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
--- /dev/null
+|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|
source shared.vim
source check.vim
+source screendump.vim
func Test_block_shift_multibyte()
" Uses double-wide character.
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