patch 8.2.3950: going beyond the end of the line with /\%V
Problem: Going beyond the end of the line with /\%V.
Solution: Check for valid column in getvcol().
diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim
index 03efdbe..f936549 100644
--- a/src/testdir/test_regexp_latin.vim
+++ b/src/testdir/test_regexp_latin.vim
@@ -1053,4 +1053,12 @@
bwipe!
endfunc
+func Test_using_invalid_visual_position()
+ " this was going beyond the end of the line
+ new
+ exe "norm 0o000\<Esc>0\<C-V>$s0"
+ /\%V
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab