annotate src/testdir/test_conceal.vim @ 18072:5f1554b2587c v8.1.2031

patch 8.1.2031: cursor position wrong when resizing and using conceal Commit: https://github.com/vim/vim/commit/5babc6e858afbfa54aa0e203a64b9c70175487b7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 14 21:55:51 2019 +0200 patch 8.1.2031: cursor position wrong when resizing and using conceal Problem: Cursor position wrong when resizing and using conceal. Solution: Set the flags that the cursor position is valid when setting the row and column during redrawing. (closes #4931)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Sep 2019 22:00:03 +0200
parents 0da9bc55c31a
children 1895dd434ecf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15426
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Tests for 'conceal'.
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Also see test88.in (should be converted to a test function here).
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
4 source check.vim
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
5 CheckFeature conceal
15426
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 source screendump.vim
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
8 CheckScreendump
15426
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 func Test_conceal_two_windows()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
11 let code =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
12 let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
13 call setline(1, lines)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
14 syntax match test /|hidden|/ conceal
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
15 set conceallevel=2
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
16 set concealcursor=
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
17 exe "normal /here\r"
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
18 new
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
19 call setline(1, lines)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
20 call setline(4, "Second window")
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
21 syntax match test /|hidden|/ conceal
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
22 set conceallevel=2
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
23 set concealcursor=nc
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
24 exe "normal /here\r"
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
25 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
26
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
27 call writefile(code, 'XTest_conceal')
15426
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 " Check that cursor line is concealed
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let buf = RunVimInTerminal('-S XTest_conceal', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 " Check that with concealed text vertical cursor movement is correct.
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call term_sendkeys(buf, "k")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 call VerifyScreenDump(buf, 'Test_conceal_two_windows_02', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 " Check that with cursor line is not concealed
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 call term_sendkeys(buf, "j")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 call term_sendkeys(buf, ":set concealcursor=\r")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 call VerifyScreenDump(buf, 'Test_conceal_two_windows_03', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 " Check that with cursor line is not concealed when moving cursor down
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 call term_sendkeys(buf, "j")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 call VerifyScreenDump(buf, 'Test_conceal_two_windows_04', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 " Check that with cursor line is not concealed when switching windows
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 call term_sendkeys(buf, "\<C-W>\<C-W>")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 call VerifyScreenDump(buf, 'Test_conceal_two_windows_05', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 " Check that with cursor line is only concealed in Normal mode
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 call term_sendkeys(buf, ":set concealcursor=n\r")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 call VerifyScreenDump(buf, 'Test_conceal_two_windows_06n', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 call term_sendkeys(buf, "a")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 call VerifyScreenDump(buf, 'Test_conceal_two_windows_06i', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 call term_sendkeys(buf, "\<Esc>/e")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 call VerifyScreenDump(buf, 'Test_conceal_two_windows_06c', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 call term_sendkeys(buf, "\<Esc>v")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 call VerifyScreenDump(buf, 'Test_conceal_two_windows_06v', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 call term_sendkeys(buf, "\<Esc>")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 " Check that with cursor line is only concealed in Insert mode
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 call term_sendkeys(buf, ":set concealcursor=i\r")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 call VerifyScreenDump(buf, 'Test_conceal_two_windows_07n', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 call term_sendkeys(buf, "a")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 call VerifyScreenDump(buf, 'Test_conceal_two_windows_07i', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 call term_sendkeys(buf, "\<Esc>/e")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 call VerifyScreenDump(buf, 'Test_conceal_two_windows_07c', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 call term_sendkeys(buf, "\<Esc>v")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 call VerifyScreenDump(buf, 'Test_conceal_two_windows_07v', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 call term_sendkeys(buf, "\<Esc>")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 " Check that with cursor line is only concealed in Command mode
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 call term_sendkeys(buf, ":set concealcursor=c\r")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 call VerifyScreenDump(buf, 'Test_conceal_two_windows_08n', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 call term_sendkeys(buf, "a")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 call VerifyScreenDump(buf, 'Test_conceal_two_windows_08i', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 call term_sendkeys(buf, "\<Esc>/e")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 call VerifyScreenDump(buf, 'Test_conceal_two_windows_08c', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 call term_sendkeys(buf, "\<Esc>v")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 call VerifyScreenDump(buf, 'Test_conceal_two_windows_08v', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 call term_sendkeys(buf, "\<Esc>")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 " Check that with cursor line is only concealed in Visual mode
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 call term_sendkeys(buf, ":set concealcursor=v\r")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 call VerifyScreenDump(buf, 'Test_conceal_two_windows_09n', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 call term_sendkeys(buf, "a")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 call VerifyScreenDump(buf, 'Test_conceal_two_windows_09i', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 call term_sendkeys(buf, "\<Esc>/e")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 call VerifyScreenDump(buf, 'Test_conceal_two_windows_09c', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 call term_sendkeys(buf, "\<Esc>v")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 call VerifyScreenDump(buf, 'Test_conceal_two_windows_09v', {})
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 call term_sendkeys(buf, "\<Esc>")
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92
15434
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
93 " Check moving the cursor while in insert mode.
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
94 call term_sendkeys(buf, ":set concealcursor=\r")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
95 call term_sendkeys(buf, "a")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
96 call VerifyScreenDump(buf, 'Test_conceal_two_windows_10', {})
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
97 call term_sendkeys(buf, "\<Down>")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
98 call VerifyScreenDump(buf, 'Test_conceal_two_windows_11', {})
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
99 call term_sendkeys(buf, "\<Esc>")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
100
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
101 " Check the "o" command
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
102 call VerifyScreenDump(buf, 'Test_conceal_two_windows_12', {})
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
103 call term_sendkeys(buf, "o")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
104 call VerifyScreenDump(buf, 'Test_conceal_two_windows_13', {})
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
105 call term_sendkeys(buf, "\<Esc>")
80e79573dd6e patch 8.1.0725: conceal mode is not completely tested
Bram Moolenaar <Bram@vim.org>
parents: 15426
diff changeset
106
15426
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 " clean up
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 call StopVimInTerminal(buf)
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 call delete('XTest_conceal')
8b78878311e0 patch 8.1.0721: conceal mode is not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 endfunc
15476
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
111
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
112 func Test_conceal_with_cursorline()
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
113 " Opens a help window, where 'conceal' is set, switches to the other window
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
114 " where 'cursorline' needs to be updated when the cursor moves.
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
115 let code =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
116 set cursorline
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
117 normal othis is a test
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
118 new
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
119 call setline(1, ["one", "two", "three", "four", "five"])
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
120 set ft=help
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
121 normal M
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
122 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
123
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15476
diff changeset
124 call writefile(code, 'XTest_conceal_cul')
15476
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
125 let buf = RunVimInTerminal('-S XTest_conceal_cul', {})
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
126 call VerifyScreenDump(buf, 'Test_conceal_cul_01', {})
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
127
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
128 call term_sendkeys(buf, ":wincmd w\r")
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
129 call VerifyScreenDump(buf, 'Test_conceal_cul_02', {})
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
130
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
131 call term_sendkeys(buf, "k")
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
132 call VerifyScreenDump(buf, 'Test_conceal_cul_03', {})
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
133
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
134 " clean up
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
135 call StopVimInTerminal(buf)
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
136 call delete('XTest_conceal_cul')
5b0f37d844b3 patch 8.1.0746: highlighting not updated with conceal and 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents: 15434
diff changeset
137 endfunc
18072
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
138
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
139 func Test_conceal_resize_term()
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
140 let code =<< trim [CODE]
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
141 call setline(1, '`one` `two` `three` `four` `five`, the backticks should be concealed')
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
142 setl cocu=n cole=3
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
143 syn region CommentCodeSpan matchgroup=Comment start=/`/ end=/`/ concealends
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
144 normal fb
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
145 [CODE]
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
146 call writefile(code, 'XTest_conceal_resize')
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
147 let buf = RunVimInTerminal('-S XTest_conceal_resize', {'rows': 6})
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
148 call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
149
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
150 call win_execute(buf->win_findbuf()[0], 'wincmd +')
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
151 call term_wait(buf)
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
152 call VerifyScreenDump(buf, 'Test_conceal_resize_02', {})
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
153
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
154 " clean up
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
155 call StopVimInTerminal(buf)
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
156 call delete('XTest_conceal_resize')
5f1554b2587c patch 8.1.2031: cursor position wrong when resizing and using conceal
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
157 endfunc