Mercurial > vim
annotate src/testdir/test_cursorline.vim @ 25358:f03271631eb5 v8.2.3216
patch 8.2.3216: Vim9: crash when using variable in a loop at script level
Commit: https://github.com/vim/vim/commit/2eb6fc3b52148f961e804ec2be361d531ff770d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 25 14:13:53 2021 +0200
patch 8.2.3216: Vim9: crash when using variable in a loop at script level
Problem: Vim9: crash when using variable in a loop at script level.
Solution: Do not clear the variable if a function was defined.
Do not create a new entry in sn_var_vals every time.
(closes #8628)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 25 Jul 2021 14:15:04 +0200 |
parents | c11fc61b0872 |
children | b04e76e66128 |
rev | line source |
---|---|
18047
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test for cursorline and cursorlineopt |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
2 |
18047
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 source check.vim |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
4 source screendump.vim |
18047
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 function! s:screen_attr(lnum) abort |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 return map(range(1, 8), 'screenattr(a:lnum, v:val)') |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 endfunction |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 function! s:test_windows(h, w) abort |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 call NewWindow(a:h, a:w) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 endfunction |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 function! s:close_windows() abort |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 call CloseWindow() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 endfunction |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 function! s:new_hi() abort |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 redir => save_hi |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 silent! hi CursorLineNr |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 redir END |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 let save_hi = join(split(substitute(save_hi, '\s*xxx\s*', ' ', ''), "\n"), '') |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 exe 'hi' save_hi 'ctermbg=0 guibg=Black' |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 return save_hi |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 endfunction |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 func Test_cursorline_highlight1() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 let save_hi = s:new_hi() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 try |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 call s:test_windows(10, 20) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 call setline(1, repeat(['aaaa'], 10)) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 let attr01 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 call assert_equal(repeat([attr01[0]], 8), attr01) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 setl number numberwidth=4 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 let attr11 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 call assert_equal(repeat([attr11[0]], 4), attr11[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 call assert_equal(repeat([attr11[4]], 4), attr11[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 call assert_notequal(attr11[0], attr11[4]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 setl cursorline |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 let attr21 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 let attr22 = s:screen_attr(2) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 call assert_equal(repeat([attr21[0]], 4), attr21[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 call assert_equal(repeat([attr21[4]], 4), attr21[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 call assert_equal(attr11, attr22) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 call assert_notequal(attr22, attr21) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 setl nocursorline relativenumber |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 let attr31 = s:screen_attr(1) |
18245
1f5571e7f012
patch 8.1.2117: CursorLine highlight used while 'cursorline' is off
Bram Moolenaar <Bram@vim.org>
parents:
18068
diff
changeset
|
55 call assert_equal(attr22[0:3], attr31[0:3]) |
18047
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 call assert_equal(attr11[4:7], attr31[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 call s:close_windows() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 finally |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 exe 'hi' save_hi |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 endtry |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 endfunc |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 func Test_cursorline_highlight2() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 CheckOption cursorlineopt |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 let save_hi = s:new_hi() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 try |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 call s:test_windows(10, 20) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 call setline(1, repeat(['aaaa'], 10)) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 let attr0 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 call assert_equal(repeat([attr0[0]], 8), attr0) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 setl number |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 let attr1 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 call assert_notequal(attr0[0:3], attr1[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 call assert_equal(attr0[0:3], attr1[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 setl cursorline cursorlineopt=both |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 let attr2 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 call assert_notequal(attr1[0:3], attr2[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 call assert_notequal(attr1[4:7], attr2[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 setl cursorlineopt=line |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 let attr3 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 call assert_equal(attr1[0:3], attr3[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 call assert_equal(attr2[4:7], attr3[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 setl cursorlineopt=number |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 let attr4 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 call assert_equal(attr2[0:3], attr4[0:3]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 call assert_equal(attr1[4:7], attr4[4:7]) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 setl nonumber |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 redraw |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 let attr5 = s:screen_attr(1) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 call assert_equal(attr0, attr5) |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 call s:close_windows() |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 finally |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 exe 'hi' save_hi |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 endtry |
6650e3dff8d4
patch 8.1.2019: 'cursorline' always highlights the whole line
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 endfunc |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
109 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
110 func Test_cursorline_screenline() |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
111 CheckScreendump |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
112 CheckOption cursorlineopt |
25334
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
113 |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
114 let filename='Xcursorline' |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
115 let lines = [] |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
116 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
117 let file_content =<< trim END |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
118 1 foooooooo ar einszwei drei vier fünf sechs sieben acht un zehn elf zwöfl dreizehn v ierzehn fünfzehn |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
119 2 foooooooo bar eins zwei drei vier fünf sechs sieben |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
120 3 foooooooo bar eins zwei drei vier fünf sechs sieben |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
121 4 foooooooo bar eins zwei drei vier fünf sechs sieben |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
122 END |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
123 let lines1 =<< trim END1 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
124 set nocp |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
125 set display=lastline |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
126 set cursorlineopt=screenline cursorline nu wrap sbr=> |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
127 hi CursorLineNr ctermfg=blue |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
128 25vsp |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
129 END1 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
130 let lines2 =<< trim END2 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
131 call cursor(1,1) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
132 END2 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
133 call extend(lines, lines1) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
134 call extend(lines, ["call append(0, ".. string(file_content).. ')']) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
135 call extend(lines, lines2) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
136 call writefile(lines, filename) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
137 " basic test |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
138 let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
139 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
140 call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
141 call term_sendkeys(buf, "fagj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
142 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
143 call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
144 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
145 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
146 call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
147 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
148 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
149 call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
150 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
151 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
152 call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
153 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
154 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
155 call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
156 " test with set list and cursorlineopt containing number |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
157 call term_sendkeys(buf, "gg0") |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
158 call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>") |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
159 call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
160 call term_sendkeys(buf, "fagj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
161 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
162 call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
163 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
164 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
165 call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
166 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
167 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
168 call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
169 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
170 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
171 call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
172 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
173 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
174 call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
175 if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
176 " test with set foldcolumn signcoloumn and breakindent |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
177 call term_sendkeys(buf, "gg0") |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
178 call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>") |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
179 call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
180 call term_sendkeys(buf, "fagj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
181 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
182 call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
183 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
184 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
185 call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
186 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
187 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
188 call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
189 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
190 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
191 call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
192 call term_sendkeys(buf, "gj") |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
18245
diff
changeset
|
193 call TermWait(buf) |
18068
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
194 call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
195 endif |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
196 |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
197 call StopVimInTerminal(buf) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
198 call delete(filename) |
1101eacc1444
patch 8.1.2029: cannot control 'cursorline' highlighting well
Bram Moolenaar <Bram@vim.org>
parents:
18047
diff
changeset
|
199 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
200 |
25334
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
201 func Test_cursorline_redraw() |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
202 CheckScreendump |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
203 CheckOption cursorlineopt |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
204 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
205 let textlines =<< END |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
206 When the option is a list of flags, {value} must be |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
207 exactly as they appear in the option. Remove flags |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
208 one by one to avoid problems. |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
209 Also see |:set-args| above. |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
210 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
211 The {option} arguments to ":set" may be repeated. For example: > |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
212 :set ai nosi sw=3 ts=3 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
213 If you make an error in one of the arguments, an error message will be given |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
214 and the following arguments will be ignored. |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
215 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
216 *:set-verbose* |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
217 When 'verbose' is non-zero, displaying an option value will also tell where it |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
218 was last set. Example: > |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
219 :verbose set shiftwidth cindent? |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
220 < shiftwidth=4 ~ |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
221 Last set from modeline line 1 ~ |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
222 cindent ~ |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
223 Last set from /usr/local/share/vim/vim60/ftplugin/c.vim line 30 ~ |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
224 This is only done when specific option values are requested, not for ":verbose |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
225 set all" or ":verbose set" without an argument. |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
226 When the option was set by hand there is no "Last set" message. |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
227 When the option was set while executing a function, user command or |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
228 END |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
229 call writefile(textlines, 'Xtextfile') |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
230 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
231 let script =<< trim END |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
232 set cursorline scrolloff=2 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
233 normal 12G |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
234 END |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
235 call writefile(script, 'Xscript') |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
236 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
237 let buf = RunVimInTerminal('-S Xscript Xtextfile', #{rows: 20, cols: 40}) |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
238 call VerifyScreenDump(buf, 'Test_cursorline_redraw_1', {}) |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
239 call term_sendkeys(buf, "zt") |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
240 call TermWait(buf) |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
241 call term_sendkeys(buf, "\<C-U>") |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
242 call VerifyScreenDump(buf, 'Test_cursorline_redraw_2', {}) |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
243 |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
244 call StopVimInTerminal(buf) |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
245 call delete('Xscript') |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
246 call delete('Xtextfile') |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
247 endfunc |
c11fc61b0872
patch 8.2.3204: display garbled when 'cursorline' is set and lines wrap
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
248 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
249 " vim: shiftwidth=2 sts=2 expandtab |