diff src/testdir/test_cursor_func.vim @ 26881:fb67cd7d30a7 v8.2.3969

patch 8.2.3969: value of MAXCOL not available in Vim script Commit: https://github.com/vim/vim/commit/56200eed62e59ad831f6564dcafe346e6f97ac20 Author: naohiro ono <obcat@icloud.com> Date: Sat Jan 1 14:59:44 2022 +0000 patch 8.2.3969: value of MAXCOL not available in Vim script Problem: Value of MAXCOL not available in Vim script. Solution: Add v:maxcol. (Naohiro Ono, closes https://github.com/vim/vim/issues/9451)
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 16:00:03 +0100
parents 7a254d0705e2
children 2bec1976362c
line wrap: on
line diff
--- a/src/testdir/test_cursor_func.vim
+++ b/src/testdir/test_cursor_func.vim
@@ -38,6 +38,18 @@ func Test_move_cursor()
   quit!
 endfunc
 
+func Test_curswant_maxcol()
+  new
+  call setline(1, 'foo')
+
+  " Test that after "$" command curswant is set to the same value as v:maxcol.
+  normal! 1G$
+  call assert_equal(v:maxcol, getcurpos()[4])
+  call assert_equal(v:maxcol, winsaveview().curswant)
+
+  quit!
+endfunc
+
 " Very short version of what matchparen does.
 function s:Highlight_Matching_Pair()
   let save_cursor = getcurpos()