comparison 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
comparison
equal deleted inserted replaced
26880:4949ec0bc329 26881:fb67cd7d30a7
32 call setline(1, ["\<TAB>"]) 32 call setline(1, ["\<TAB>"])
33 call cursor(1, 1, 1) 33 call cursor(1, 1, 1)
34 call assert_equal([1, 1, 1], getcurpos()[1:3]) 34 call assert_equal([1, 1, 1], getcurpos()[1:3])
35 35
36 call assert_fails('call cursor(-1, -1)', 'E475:') 36 call assert_fails('call cursor(-1, -1)', 'E475:')
37
38 quit!
39 endfunc
40
41 func Test_curswant_maxcol()
42 new
43 call setline(1, 'foo')
44
45 " Test that after "$" command curswant is set to the same value as v:maxcol.
46 normal! 1G$
47 call assert_equal(v:maxcol, getcurpos()[4])
48 call assert_equal(v:maxcol, winsaveview().curswant)
37 49
38 quit! 50 quit!
39 endfunc 51 endfunc
40 52
41 " Very short version of what matchparen does. 53 " Very short version of what matchparen does.