comparison src/testdir/test_normal.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 efe4c8a79502
children 5aa9e8db975c
comparison
equal deleted inserted replaced
26880:4949ec0bc329 26881:fb67cd7d30a7
856 call assert_equal([0, 92, 1, 0, 1], getcurpos()) 856 call assert_equal([0, 92, 1, 0, 1], getcurpos())
857 100 857 100
858 set nostartofline 858 set nostartofline
859 exe "norm! $\<c-b>" 859 exe "norm! $\<c-b>"
860 call assert_equal('92', getline('.')) 860 call assert_equal('92', getline('.'))
861 call assert_equal([0, 92, 2, 0, 2147483647], getcurpos()) 861 call assert_equal([0, 92, 2, 0, v:maxcol], getcurpos())
862 " cleanup 862 " cleanup
863 set startofline 863 set startofline
864 bw! 864 bw!
865 endfunc 865 endfunc
866 866
900 " Test for zb 900 " Test for zb
901 30 901 30
902 norm! >>$ztzb 902 norm! >>$ztzb
903 call assert_equal(' 30', getline('.')) 903 call assert_equal(' 30', getline('.'))
904 call assert_equal(30, winsaveview()['topline']+winheight(0)-1) 904 call assert_equal(30, winsaveview()['topline']+winheight(0)-1)
905 call assert_equal([0, 30, 3, 0, 2147483647], getcurpos()) 905 call assert_equal([0, 30, 3, 0, v:maxcol], getcurpos())
906 906
907 " Test for z- 907 " Test for z-
908 1 908 1
909 30 909 30
910 norm! 0z- 910 norm! 0z-
2796 call assert_equal([0, 13, 26, 0, 26], getcurpos()) 2796 call assert_equal([0, 13, 26, 0, 26], getcurpos())
2797 norm! 103go 2797 norm! 103go
2798 call assert_equal([0, 14, 1, 0, 1], getcurpos()) 2798 call assert_equal([0, 14, 1, 0, 1], getcurpos())
2799 " count > buffer content 2799 " count > buffer content
2800 norm! 120go 2800 norm! 120go
2801 call assert_equal([0, 14, 1, 0, 2147483647], getcurpos()) 2801 call assert_equal([0, 14, 1, 0, v:maxcol], getcurpos())
2802 " clean up 2802 " clean up
2803 bw! 2803 bw!
2804 endfunc 2804 endfunc
2805 2805
2806 " Test for gt and gT 2806 " Test for gt and gT
2978 call assert_equal([0, 95, 1, 0, 1], getcurpos()) 2978 call assert_equal([0, 95, 1, 0, 1], getcurpos())
2979 100 2979 100
2980 set nostartofline 2980 set nostartofline
2981 exe "norm! $\<c-u>" 2981 exe "norm! $\<c-u>"
2982 call assert_equal('95', getline('.')) 2982 call assert_equal('95', getline('.'))
2983 call assert_equal([0, 95, 2, 0, 2147483647], getcurpos()) 2983 call assert_equal([0, 95, 2, 0, v:maxcol], getcurpos())
2984 " cleanup 2984 " cleanup
2985 set startofline 2985 set startofline
2986 bw! 2986 bw!
2987 endfunc 2987 endfunc
2988 2988