Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 1 | " Tests for tabpanel |
| 2 | |
| 3 | source check.vim |
| 4 | source screendump.vim |
| 5 | CheckFeature tabpanel |
| 6 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 7 | function s:reset() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8 | set tabpanel& |
| 9 | set tabpanelopt& |
| 10 | set showtabpanel& |
| 11 | endfunc |
| 12 | |
Hirohito Higashi | f5aa269 | 2025-06-15 16:09:22 +0200 | [diff] [blame] | 13 | function Test_tabpanel_showtabpanel_eq_0() |
| 14 | CheckScreendump |
| 15 | |
| 16 | let lines =<< trim END |
| 17 | set showtabpanel=2 |
| 18 | set noruler |
| 19 | call setbufline(bufnr(), 1, ['aaa','bbb','ccc','ddd']) |
| 20 | tabnew 0000 |
| 21 | END |
| 22 | call writefile(lines, 'XTest_tabpanel_stpl_eq_0', 'D') |
| 23 | |
| 24 | let buf = RunVimInTerminal('-S XTest_tabpanel_stpl_eq_0', {'rows': 10, 'cols': 78}) |
| 25 | call term_sendkeys(buf, ":set showtabpanel=0\<CR>\<C-L>") |
| 26 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_0_0', {}) |
| 27 | call term_sendkeys(buf, ":tabnext\<CR>\<C-L>") |
| 28 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_0_1', {}) |
Hirohito Higashi | acd04b2 | 2025-06-16 20:26:08 +0200 | [diff] [blame] | 29 | call term_sendkeys(buf, ":set showtabpanel=2\<CR>") |
| 30 | call term_sendkeys(buf, ":vsp aaa\<CR>:vsp bbb\<CR>\<C-L>") |
| 31 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_0_2', {}) |
| 32 | call term_sendkeys(buf, ":set showtabpanel=0\<CR>\<C-L>") |
| 33 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_0_3', {}) |
| 34 | call term_sendkeys(buf, ":wincmd |\<CR>") |
| 35 | call term_sendkeys(buf, ":set showtabpanel=2\<CR>\<C-L>") |
| 36 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_0_2', {}) |
Hirohito Higashi | f5aa269 | 2025-06-15 16:09:22 +0200 | [diff] [blame] | 37 | call StopVimInTerminal(buf) |
| 38 | endfunc |
| 39 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 40 | function Test_tabpanel_showtabpanel_eq_1() |
| 41 | CheckScreendump |
| 42 | |
| 43 | let lines =<< trim END |
| 44 | set showtabpanel=1 |
| 45 | set noruler |
| 46 | END |
| 47 | call writefile(lines, 'XTest_tabpanel_stpl_eq_1', 'D') |
| 48 | |
| 49 | let buf = RunVimInTerminal('-S XTest_tabpanel_stpl_eq_1', {'rows': 10, 'cols': 78}) |
| 50 | call term_sendkeys(buf, "\<C-L>") |
| 51 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_0', {}) |
| 52 | call term_sendkeys(buf, ":tabnew\<CR>\<C-L>") |
| 53 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_1', {}) |
| 54 | call term_sendkeys(buf, ":tabfirst\<CR>:vsplit\<CR>\<C-L>") |
| 55 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_2', {}) |
| 56 | call term_sendkeys(buf, ":tabclose\<CR>\<C-L>") |
| 57 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_0', {}) |
| 58 | |
| 59 | call term_sendkeys(buf, ":set tabpanelopt=align:right\<CR>\<C-L>") |
| 60 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_0', {}) |
| 61 | call term_sendkeys(buf, ":tabnew\<CR>\<C-L>") |
| 62 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_3', {}) |
| 63 | call term_sendkeys(buf, ":tabfirst\<CR>:vsplit\<CR>\<C-L>") |
| 64 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_4', {}) |
| 65 | call term_sendkeys(buf, ":tabclose\<CR>\<C-L>") |
| 66 | call VerifyScreenDump(buf, 'Test_tabpanel_stpl_eq_1_0', {}) |
| 67 | call StopVimInTerminal(buf) |
| 68 | endfunc |
| 69 | |
| 70 | function Test_tabpanel_with_vsplit() |
| 71 | CheckScreendump |
| 72 | |
| 73 | let lines =<< trim END |
| 74 | set showtabpanel=2 |
| 75 | set tabpanelopt=columns:20 |
| 76 | set showtabline=0 |
| 77 | tabnew |
| 78 | END |
| 79 | call writefile(lines, 'XTest_tabpanel_with_vsplit', 'D') |
| 80 | |
| 81 | let buf = RunVimInTerminal('-S XTest_tabpanel_with_vsplit', {'rows': 10, 'cols': 78}) |
| 82 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_0', {}) |
| 83 | call term_sendkeys(buf, ":vsplit\<CR>") |
| 84 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_1', {}) |
| 85 | call term_sendkeys(buf, ":vsplit\<CR>") |
| 86 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_2', {}) |
| 87 | |
| 88 | call term_sendkeys(buf, ":only\<CR>") |
| 89 | call term_sendkeys(buf, ":set tabpanelopt=align:right,vert\<CR>") |
| 90 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_3', {}) |
| 91 | call term_sendkeys(buf, ":vsplit\<CR>") |
| 92 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_4', {}) |
| 93 | call term_sendkeys(buf, ":vsplit\<CR>") |
| 94 | call VerifyScreenDump(buf, 'Test_tabpanel_with_vsplit_5', {}) |
| 95 | call StopVimInTerminal(buf) |
| 96 | endfunc |
| 97 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 98 | function Test_tabpanel_mouse() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 99 | let save_showtabline = &showtabline |
| 100 | let save_mouse = &mouse |
| 101 | set showtabline=0 mouse=a |
| 102 | |
| 103 | tabnew |
| 104 | tabnew |
| 105 | |
| 106 | call test_setmouse(1, 1) |
| 107 | call feedkeys("\<LeftMouse>", 'xt') |
| 108 | call assert_equal(3, tabpagenr()) |
| 109 | |
| 110 | set showtabpanel=2 tabpanelopt=columns:10 |
| 111 | |
| 112 | call test_setmouse(1, 1) |
| 113 | call feedkeys("\<LeftMouse>", 'xt') |
| 114 | call assert_equal(1, tabpagenr()) |
| 115 | call test_setmouse(2, 1) |
| 116 | call feedkeys("\<LeftMouse>", 'xt') |
| 117 | call assert_equal(2, tabpagenr()) |
| 118 | call test_setmouse(3, 1) |
| 119 | call feedkeys("\<LeftMouse>", 'xt') |
| 120 | call assert_equal(3, tabpagenr()) |
| 121 | |
Hirohito Higashi | a1522f7 | 2025-06-03 21:07:25 +0200 | [diff] [blame] | 122 | " Confirm that tabpagenr() does not change when dragging outside the tabpanel |
| 123 | call test_setmouse(3, 30) |
| 124 | call feedkeys("\<LeftMouse>", 'xt') |
| 125 | call test_setmouse(1, 30) |
| 126 | call feedkeys("\<LeftDrag>", 'xt') |
| 127 | call assert_equal(3, tabpagenr()) |
| 128 | |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 129 | call feedkeys("\<LeftMouse>", 'xt') |
| 130 | call test_setmouse(2, 3) |
| 131 | let pos = getmousepos() |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 132 | call assert_equal(0, pos['winid']) |
| 133 | call assert_equal(0, pos['winrow']) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 134 | call assert_equal(0, pos['wincol']) |
| 135 | call assert_equal(2, pos['screenrow']) |
| 136 | call assert_equal(3, pos['screencol']) |
| 137 | |
| 138 | call test_setmouse(1, 11) |
| 139 | call feedkeys("\<LeftMouse>", 'xt') |
| 140 | let pos = getmousepos() |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 141 | call assert_notequal(0, pos['winid']) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 142 | call assert_equal(1, pos['winrow']) |
| 143 | call assert_equal(1, pos['wincol']) |
| 144 | call assert_equal(1, pos['screenrow']) |
| 145 | call assert_equal(11, pos['screencol']) |
| 146 | |
| 147 | new |
| 148 | wincmd x |
| 149 | |
| 150 | call test_setmouse(10, 11) |
| 151 | call feedkeys("\<LeftMouse>", 'xt') |
| 152 | let pos = getmousepos() |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 153 | call assert_notequal(0, pos['winid']) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 154 | call assert_equal(10, pos['winrow']) |
| 155 | call assert_equal(1, pos['wincol']) |
| 156 | call assert_equal(10, pos['screenrow']) |
| 157 | call assert_equal(11, pos['screencol']) |
| 158 | |
| 159 | tabonly! |
| 160 | call s:reset() |
| 161 | let &mouse = save_mouse |
| 162 | let &showtabline = save_showtabline |
| 163 | endfunc |
| 164 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 165 | function Test_tabpanel_drawing() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 166 | CheckScreendump |
| 167 | |
| 168 | let lines =<< trim END |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 169 | function MyTabPanel() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 170 | let n = g:actual_curtabpage |
| 171 | let hi = n == tabpagenr() ? 'TabLineSel' : 'TabLine' |
| 172 | let label = printf("\n%%#%sTabNumber#%d:%%#%s#", hi, n, hi) |
| 173 | let label ..= '%1*%f%*' |
| 174 | return label |
| 175 | endfunction |
| 176 | hi User1 ctermfg=12 |
| 177 | |
| 178 | set showtabline=0 |
| 179 | set showtabpanel=0 |
| 180 | set tabpanelopt=columns:16 |
| 181 | set tabpanel= |
| 182 | silent edit Xtabpanel1 |
| 183 | |
| 184 | nnoremap \01 <Cmd>set showtabpanel=2<CR> |
| 185 | nnoremap \02 <C-w>v |
| 186 | nnoremap \03 <Cmd>call setline(1, ['a', 'b', 'c'])<CR> |
| 187 | nnoremap \04 <Cmd>silent tabnew Xtabpanel2<CR><Cmd>call setline(1, ['d', 'e', 'f'])<CR> |
| 188 | nnoremap \05 <Cmd>set tabpanel=%!MyTabPanel()<CR> |
| 189 | nnoremap \06 <Cmd>set tabpanelopt+=align:right<CR> |
| 190 | nnoremap \07 <Cmd>tab terminal NONE<CR><C-w>N |
| 191 | nnoremap \08 <Cmd>tabclose!<CR><Cmd>tabclose!<CR> |
| 192 | END |
| 193 | call writefile(lines, 'XTest_tabpanel', 'D') |
| 194 | |
| 195 | let buf = RunVimInTerminal('-S XTest_tabpanel', {'rows': 6, 'cols': 45}) |
| 196 | |
| 197 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_00', {}) |
| 198 | |
| 199 | for i in range(1, 8) |
| 200 | let n = printf('%02d', i) |
| 201 | call term_sendkeys(buf, '\' .. n) |
| 202 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_' .. n, {}) |
| 203 | endfor |
| 204 | |
| 205 | call StopVimInTerminal(buf) |
| 206 | endfunc |
| 207 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 208 | function Test_tabpanel_drawing_with_popupwin() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 209 | CheckScreendump |
| 210 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 211 | let tcols = 45 |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 212 | let lines =<< trim END |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 213 | set showtabpanel=0 |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 214 | set tabpanelopt=columns:20 |
| 215 | set showtabline=0 |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 216 | set nowrap |
| 217 | set noruler |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 218 | tabnew |
| 219 | setlocal buftype=nofile |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 220 | call setbufline(bufnr(), 1, repeat([repeat('.', &columns)], &lines - &ch)) |
| 221 | for col in [1, &columns - 2] |
| 222 | call popup_create(['@'], |
| 223 | \ { |
| 224 | \ 'line': 1, |
| 225 | \ 'col': col, |
| 226 | \ 'border': [], |
| 227 | \ 'highlight': 'ErrorMsg', |
| 228 | \ }) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 229 | endfor |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 230 | call cursor(5, 10) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 231 | call popup_atcursor('atcursor', { |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 232 | \ 'highlight': 'Question', |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 233 | \ }) |
| 234 | END |
| 235 | call writefile(lines, 'XTest_tabpanel_with_popupwin', 'D') |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 236 | let buf = RunVimInTerminal('-S XTest_tabpanel_with_popupwin', {'rows': 10, 'cols': tcols}) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 237 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_with_popupwin_0', {}) |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 238 | call term_sendkeys(buf, ":set showtabpanel=2\<CR>\<C-L>") |
| 239 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_with_popupwin_1', {}) |
| 240 | call term_sendkeys(buf, ":set tabpanelopt+=align:right\<CR>\<C-L>") |
| 241 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_with_popupwin_2', {}) |
| 242 | call term_sendkeys(buf, ":set showtabpanel=0\<CR>\<C-L>") |
| 243 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_with_popupwin_0', {}) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 244 | call StopVimInTerminal(buf) |
| 245 | endfunc |
| 246 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 247 | function Test_tabpanel_drawing_fill_tailing() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 248 | CheckScreendump |
| 249 | |
| 250 | let lines =<< trim END |
| 251 | set showtabpanel=2 |
| 252 | set tabpanelopt=columns:20 |
| 253 | set showtabline=0 |
| 254 | e aaa.txt |
| 255 | tabnew |
| 256 | e bbb.txt |
| 257 | let &tabpanel = "abc" |
| 258 | redraw! |
| 259 | " Check whether "abc" is cleared |
| 260 | let &tabpanel = "\nTOP\n%f\nBOTTOM" |
| 261 | END |
| 262 | call writefile(lines, 'XTest_tabpanel_fill_tailing', 'D') |
| 263 | |
| 264 | let buf = RunVimInTerminal('-S XTest_tabpanel_fill_tailing', {'rows': 10, 'cols': 45}) |
| 265 | |
| 266 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_fill_tailing_0', {}) |
| 267 | |
| 268 | call StopVimInTerminal(buf) |
| 269 | endfunc |
| 270 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 271 | function Test_tabpanel_drawing_pum() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 272 | CheckScreendump |
| 273 | |
| 274 | let lines =<< trim END |
| 275 | set showtabpanel=2 |
| 276 | set tabpanelopt=columns:20 |
| 277 | set showtabline=0 |
| 278 | e aaa.txt |
| 279 | tabnew |
| 280 | e bbb.txt |
| 281 | END |
| 282 | call writefile(lines, 'XTest_tabpanel_pum', 'D') |
| 283 | |
| 284 | let buf = RunVimInTerminal('-S XTest_tabpanel_pum', {'rows': 10, 'cols': 45}) |
| 285 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 286 | call term_sendkeys(buf, "i\<CR>aa\<CR>aaaa\<CR>aaac\<CR>aaab\<CR>\<Esc>") |
| 287 | call term_sendkeys(buf, "ggi\<C-X>\<C-N>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 288 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_pum_0', {}) |
| 289 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 290 | call term_sendkeys(buf, "\<Esc>Go a\<C-X>\<C-P>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 291 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_pum_1', {}) |
| 292 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 293 | call term_sendkeys(buf, "\<C-U>\<CR>\<Esc>") |
| 294 | call term_sendkeys(buf, ":set tabpanelopt+=align:right\<CR>") |
| 295 | let num = 45 - 20 - 2 " term-win-width - tabpanel-columns - 2 |
| 296 | call term_sendkeys(buf, num .. "a \<Esc>") |
| 297 | call term_sendkeys(buf, "a\<C-X>\<C-N>") |
| 298 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_pum_2', {}) |
| 299 | |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 300 | call StopVimInTerminal(buf) |
| 301 | endfunc |
| 302 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 303 | function Test_tabpanel_scrolling() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 304 | CheckScreendump |
| 305 | |
| 306 | let lines =<< trim END |
| 307 | set showtabpanel=2 |
| 308 | set tabpanelopt=columns:20 |
| 309 | set showtabline=0 |
| 310 | set nowrap |
| 311 | set number |
| 312 | e aaa.txt |
| 313 | tabnew |
| 314 | e bbb.txt |
| 315 | vsplit |
| 316 | call setbufline(bufnr(), 1, repeat(['text text text text'], 100)) |
| 317 | wincmd = |
| 318 | END |
| 319 | call writefile(lines, 'XTest_tabpanel_scrolling', 'D') |
| 320 | |
| 321 | let buf = RunVimInTerminal('-S XTest_tabpanel_scrolling', {'rows': 10, 'cols': 45}) |
| 322 | let n = 0 |
| 323 | for c in ['H', 'J', 'K', 'L'] |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 324 | call term_sendkeys(buf, ":wincmd " .. c .. "\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 325 | call term_sendkeys(buf, "\<C-d>\<C-d>") |
| 326 | call term_sendkeys(buf, "r@") |
| 327 | call VerifyScreenDump(buf, 'Test_tabpanel_drawing_scrolling_' .. n, {}) |
| 328 | let n += 1 |
| 329 | endfor |
| 330 | |
| 331 | call StopVimInTerminal(buf) |
| 332 | endfunc |
| 333 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 334 | function Test_tabpanel_many_tabpages() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 335 | CheckScreendump |
| 336 | |
| 337 | let lines =<< trim END |
| 338 | set showtabpanel=2 |
| 339 | set tabpanelopt=columns:10 |
| 340 | set showtabline=0 |
| 341 | set tabpanel=%{g:actual_curtabpage}:tab |
| 342 | execute join(repeat(['tabnew'], 20), ' | ') |
| 343 | END |
| 344 | call writefile(lines, 'XTest_tabpanel_many_tabpages', 'D') |
| 345 | |
| 346 | let buf = RunVimInTerminal('-S XTest_tabpanel_many_tabpages', {'rows': 10, 'cols': 45}) |
| 347 | for n in range(0, 3) |
| 348 | call term_sendkeys(buf, "gt") |
| 349 | call VerifyScreenDump(buf, 'Test_tabpanel_many_tabpages_' .. n, {}) |
| 350 | endfor |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 351 | call term_sendkeys(buf, ":tabnext +10\<CR>") |
| 352 | call term_sendkeys(buf, ":tabnext -3\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 353 | call VerifyScreenDump(buf, 'Test_tabpanel_many_tabpages_4', {}) |
| 354 | |
| 355 | call StopVimInTerminal(buf) |
| 356 | endfunc |
| 357 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 358 | function Test_tabpanel_visual() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 359 | CheckScreendump |
| 360 | |
| 361 | let lines =<< trim END |
| 362 | set showtabpanel=2 |
| 363 | set tabpanelopt=columns:10 |
| 364 | set showtabline=0 |
| 365 | tabnew |
| 366 | call setbufline(bufnr(), 1, ['aaa1 bbb1 ccc1 ddd1', 'aaa2 bbb2 ccc2 ddd2', 'aaa3 bbb3 ccc3 ddd3', 'aaa4 bbb4 ccc4 ddd4']) |
| 367 | END |
| 368 | call writefile(lines, 'XTest_tabpanel_visual', 'D') |
| 369 | |
| 370 | let buf = RunVimInTerminal('-S XTest_tabpanel_visual', {'rows': 10, 'cols': 45}) |
| 371 | call term_sendkeys(buf, "v2w") |
| 372 | call VerifyScreenDump(buf, 'Test_tabpanel_visual_0', {}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 373 | call term_sendkeys(buf, "\<Esc>0jw") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 374 | call term_sendkeys(buf, "v2wge") |
| 375 | call VerifyScreenDump(buf, 'Test_tabpanel_visual_1', {}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 376 | call term_sendkeys(buf, "y:echo @\"\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 377 | call VerifyScreenDump(buf, 'Test_tabpanel_visual_2', {}) |
| 378 | |
| 379 | call StopVimInTerminal(buf) |
| 380 | endfunc |
| 381 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 382 | function Test_tabpanel_commandline() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 383 | CheckScreendump |
| 384 | |
| 385 | let lines =<< trim END |
| 386 | set showtabpanel=2 |
| 387 | set tabpanelopt=columns:10 |
| 388 | set showtabline=0 |
| 389 | tabnew |
| 390 | END |
| 391 | call writefile(lines, 'XTest_tabpanel_commandline', 'D') |
| 392 | |
| 393 | let buf = RunVimInTerminal('-S XTest_tabpanel_commandline', {'rows': 10, 'cols': 45}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 394 | call term_sendkeys(buf, ":ab\<Tab>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 395 | call VerifyScreenDump(buf, 'Test_tabpanel_commandline_0', {}) |
| 396 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 397 | call term_sendkeys(buf, "\<Esc>") |
| 398 | call term_sendkeys(buf, ":set wildoptions=pum\<CR>") |
| 399 | call term_sendkeys(buf, ":ab\<Tab>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 400 | call VerifyScreenDump(buf, 'Test_tabpanel_commandline_1', {}) |
| 401 | |
| 402 | call StopVimInTerminal(buf) |
| 403 | endfunc |
| 404 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 405 | function Test_tabpanel_tabline_and_tabpanel() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 406 | CheckScreendump |
| 407 | |
| 408 | let lines =<< trim END |
| 409 | set showtabpanel=2 |
| 410 | set tabpanelopt=columns:10,vert |
| 411 | set fillchars=tpl_vert:│ |
| 412 | set showtabline=2 |
| 413 | e aaa.txt |
| 414 | tabnew |
| 415 | e bbb.txt |
| 416 | tabnew |
| 417 | e ccc.txt |
| 418 | END |
| 419 | call writefile(lines, 'XTest_tabpanel_tabline_and_tabpanel', 'D') |
| 420 | |
| 421 | let buf = RunVimInTerminal('-S XTest_tabpanel_tabline_and_tabpanel', {'rows': 10, 'cols': 45}) |
| 422 | call VerifyScreenDump(buf, 'Test_tabpanel_tabline_and_tabpanel_0', {}) |
| 423 | |
| 424 | call StopVimInTerminal(buf) |
| 425 | endfunc |
| 426 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 427 | function Test_tabpanel_dont_overflow_into_tabpanel() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 428 | CheckScreendump |
| 429 | |
| 430 | let lines =<< trim END |
| 431 | set showtabpanel=2 |
| 432 | set tabpanelopt=columns:10 |
| 433 | set showtabline=2 |
| 434 | tabnew |
| 435 | call setline(1, repeat('x', 100)) |
| 436 | set wrap |
| 437 | END |
| 438 | call writefile(lines, 'XTest_tabpanel_dont_overflow_into_tabpanel', 'D') |
| 439 | |
| 440 | let buf = RunVimInTerminal('-S XTest_tabpanel_dont_overflow_into_tabpanel', {'rows': 10, 'cols': 45}) |
| 441 | call VerifyScreenDump(buf, 'Test_tabpanel_dont_overflow_into_tabpanel_0', {}) |
| 442 | |
| 443 | call StopVimInTerminal(buf) |
| 444 | endfunc |
| 445 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 446 | """function Test_tabpanel_dont_vert_is_multibytes_left() |
| 447 | """ CheckScreendump |
| 448 | """ |
| 449 | """ let lines =<< trim END |
| 450 | """ set showtabpanel=2 |
| 451 | """ set tabpanelopt=columns:10,vert |
| 452 | """ set fillchars=tpl_vert:│ |
| 453 | """ set showtabline=2 |
| 454 | """ tabnew |
| 455 | """ END |
| 456 | """ call writefile(lines, 'XTest_tabpanel_vert_is_multibyte_lefts', 'D') |
| 457 | """ |
| 458 | """ let buf = RunVimInTerminal('-S XTest_tabpanel_vert_is_multibyte_lefts', {'rows': 10, 'cols': 45}) |
| 459 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_left_0', {}) |
| 460 | """ |
| 461 | """ call term_sendkeys(buf, ":set tabpanelopt=columns:1,vert\<CR>") |
| 462 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_left_1', {}) |
| 463 | """ |
| 464 | """ call term_sendkeys(buf, ":set tabpanelopt=columns:10,vert\<CR>") |
| 465 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_left_2', {}) |
| 466 | """ |
| 467 | """ call term_sendkeys(buf, ":set tabpanelopt=columns:2,vert\<CR>") |
| 468 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_left_3', {}) |
| 469 | """ |
| 470 | """ call StopVimInTerminal(buf) |
| 471 | """endfunc |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 472 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 473 | """function Test_tabpanel_dont_vert_is_multibytes_right() |
| 474 | """ CheckScreendump |
| 475 | """ |
| 476 | """ let lines =<< trim END |
| 477 | """ set showtabpanel=2 |
| 478 | """ set tabpanelopt=align:right,columns:10,vert |
| 479 | """ set fillchars=tpl_vert:│ |
| 480 | """ set showtabline=2 |
| 481 | """ tabnew |
| 482 | """ END |
| 483 | """ call writefile(lines, 'XTest_tabpanel_vert_is_multibytes_right', 'D') |
| 484 | """ |
| 485 | """ let buf = RunVimInTerminal('-S XTest_tabpanel_vert_is_multibytes_right', {'rows': 10, 'cols': 45}) |
| 486 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_right_0', {}) |
| 487 | """ |
| 488 | """ call term_sendkeys(buf, ":set tabpanelopt=align:right,columns:1,vert\<CR>") |
| 489 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_right_1', {}) |
| 490 | """ |
| 491 | """ call term_sendkeys(buf, ":set tabpanelopt=align:right,columns:10,vert\<CR>") |
| 492 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_right_2', {}) |
| 493 | """ |
| 494 | """ call term_sendkeys(buf, ":set tabpanelopt=align:right,columns:2,vert\<CR>") |
| 495 | """ call VerifyScreenDump(buf, 'Test_tabpanel_vert_is_multibytes_right_3', {}) |
| 496 | """ |
| 497 | """ call StopVimInTerminal(buf) |
| 498 | """endfunc |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 499 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 500 | function Test_tabpanel_eval_tabpanel_statusline_tabline() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 501 | CheckScreendump |
| 502 | |
| 503 | let lines =<< trim END |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 504 | function Expr() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 505 | return "$%=[%f]%=$" |
| 506 | endfunction |
| 507 | set laststatus=2 |
| 508 | set showtabline=2 |
| 509 | set showtabpanel=2 |
| 510 | set statusline=%!Expr() |
| 511 | set tabline=%!Expr() |
| 512 | set tabpanel=%!Expr() |
| 513 | set tabpanelopt=columns:10,vert |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 514 | e aaa |
| 515 | tabnew |
| 516 | e bbb |
| 517 | tabnew |
| 518 | e ccc |
| 519 | END |
| 520 | call writefile(lines, 'XTest_tabpanel_eval_tabpanel_statusline_tabline', 'D') |
| 521 | |
| 522 | let buf = RunVimInTerminal('-S XTest_tabpanel_eval_tabpanel_statusline_tabline', {'rows': 10, 'cols': 45}) |
| 523 | call VerifyScreenDump(buf, 'Test_tabpanel_eval_tabpanel_statusline_tabline_0', {}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 524 | call term_sendkeys(buf, ":set tabpanelopt+=align:right\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 525 | call VerifyScreenDump(buf, 'Test_tabpanel_eval_tabpanel_statusline_tabline_1', {}) |
| 526 | |
| 527 | call StopVimInTerminal(buf) |
| 528 | endfunc |
| 529 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 530 | function Test_tabpanel_noeval_tabpanel_statusline_tabline() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 531 | CheckScreendump |
| 532 | |
| 533 | let lines =<< trim END |
| 534 | set laststatus=2 |
| 535 | set showtabline=2 |
| 536 | set showtabpanel=2 |
| 537 | set statusline=$%=[%f]%=$ |
| 538 | set tabline=$%=[%f]%=$ |
| 539 | set tabpanel=$%=[%f]%=$ |
| 540 | set tabpanelopt=columns:10,vert |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 541 | e aaa |
| 542 | tabnew |
| 543 | e bbb |
| 544 | tabnew |
| 545 | e ccc |
| 546 | END |
| 547 | call writefile(lines, 'XTest_tabpanel_noeval_tabpanel_statusline_tabline', 'D') |
| 548 | |
| 549 | let buf = RunVimInTerminal('-S XTest_tabpanel_noeval_tabpanel_statusline_tabline', {'rows': 10, 'cols': 45}) |
| 550 | call VerifyScreenDump(buf, 'Test_tabpanel_noeval_tabpanel_statusline_tabline_0', {}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 551 | call term_sendkeys(buf, ":set tabpanelopt+=align:right\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 552 | call VerifyScreenDump(buf, 'Test_tabpanel_noeval_tabpanel_statusline_tabline_1', {}) |
| 553 | |
| 554 | call StopVimInTerminal(buf) |
| 555 | endfunc |
| 556 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 557 | function Test_tabpanel_eval_tabpanel_with_linebreaks() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 558 | CheckScreendump |
| 559 | |
| 560 | let lines =<< trim END |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 561 | function Expr() |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 562 | return "top\n$%=[%f]%=$\nbottom" |
| 563 | endfunction |
| 564 | set showtabpanel=2 |
| 565 | set tabpanel=%!Expr() |
| 566 | set tabpanelopt=columns:10 |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 567 | set noruler |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 568 | e aaa |
| 569 | tabnew |
| 570 | e bbb |
| 571 | tabnew |
| 572 | e ccc |
| 573 | END |
| 574 | call writefile(lines, 'XTest_tabpanel_eval_tabpanel_with_linebreaks', 'D') |
| 575 | |
| 576 | let buf = RunVimInTerminal('-S XTest_tabpanel_eval_tabpanel_with_linebreaks', {'rows': 10, 'cols': 45}) |
| 577 | call VerifyScreenDump(buf, 'Test_tabpanel_eval_tabpanel_with_linebreaks_0', {}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 578 | call term_sendkeys(buf, ":set tabpanelopt+=align:right\<CR>") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 579 | call VerifyScreenDump(buf, 'Test_tabpanel_eval_tabpanel_with_linebreaks_1', {}) |
| 580 | |
| 581 | call StopVimInTerminal(buf) |
| 582 | endfunc |
| 583 | |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 584 | function Test_tabpanel_tabonly() |
| 585 | CheckScreendump |
| 586 | |
| 587 | let lines =<< trim END |
| 588 | tabnew |
| 589 | set showtabpanel=1 |
| 590 | norm 100oasdf |
| 591 | vsplit |
| 592 | END |
| 593 | call writefile(lines, 'XTest_tabpanel_tabonly', 'D') |
| 594 | |
Christian Brabandt | a004e51 | 2025-05-26 19:54:07 +0200 | [diff] [blame] | 595 | let buf = RunVimInTerminal('-S XTest_tabpanel_tabonly', {'rows': 10, 'cols': 78}) |
Hirohito Higashi | c659e4a | 2025-05-16 19:34:34 +0200 | [diff] [blame] | 596 | call VerifyScreenDump(buf, 'Test_tabpanel_only_0', {}) |
| 597 | call term_sendkeys(buf, ":tabonly\<CR>") |
| 598 | call VerifyScreenDump(buf, 'Test_tabpanel_only_1', {}) |
| 599 | |
| 600 | call StopVimInTerminal(buf) |
| 601 | endfunc |
| 602 | |
Naruhiko Nishino | 2a1e253 | 2025-05-17 16:19:24 +0200 | [diff] [blame] | 603 | function Test_tabpanel_equalalways() |
| 604 | CheckScreendump |
| 605 | |
| 606 | let lines =<< trim END |
| 607 | tabnew |
| 608 | set showtabpanel=1 |
| 609 | set tabpanelopt=columns:20 |
| 610 | set equalalways |
| 611 | split |
| 612 | vsplit |
| 613 | END |
| 614 | call writefile(lines, 'XTest_tabpanel_equalalways', 'D') |
| 615 | |
| 616 | let buf = RunVimInTerminal('-S XTest_tabpanel_equalalways', {'rows': 10, 'cols': 78}) |
| 617 | call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_0', {}) |
| 618 | call term_sendkeys(buf, ":set tabpanelopt=columns:10\<CR>") |
| 619 | call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_1', {}) |
| 620 | call term_sendkeys(buf, ":set tabpanelopt=columns:30\<CR>") |
| 621 | call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_2', {}) |
| 622 | call term_sendkeys(buf, ":set tabpanelopt=columns:5\<CR>") |
| 623 | call VerifyScreenDump(buf, 'Test_tabpanel_equalalways_3', {}) |
| 624 | |
| 625 | call StopVimInTerminal(buf) |
| 626 | endfunc |
| 627 | |
Hirohito Higashi | 3b9b95d | 2025-06-01 20:22:55 +0200 | [diff] [blame] | 628 | function Test_tabpanel_quitall() |
| 629 | CheckScreendump |
| 630 | |
| 631 | let lines =<< trim END |
| 632 | tabnew |
| 633 | set showtabpanel=1 |
| 634 | set laststatus=2 |
| 635 | call setline(1, 'aaa') |
| 636 | normal gt |
| 637 | silent! quitall |
| 638 | END |
| 639 | call writefile(lines, 'XTest_tabpanel_quitall', 'D') |
| 640 | |
| 641 | let buf = RunVimInTerminal('-S XTest_tabpanel_quitall', {'rows': 10, 'cols': 45}) |
| 642 | call VerifyScreenDump(buf, 'Test_tabpanel_quitall_0', {}) |
| 643 | |
| 644 | call StopVimInTerminal(buf) |
| 645 | endfunc |
| 646 | |
| 647 | function Test_tabpanel_ruler() |
| 648 | CheckScreendump |
| 649 | |
| 650 | let lines =<< trim END |
| 651 | tabnew |
| 652 | set statusline& laststatus=0 |
| 653 | set rulerformat& ruler |
| 654 | set showtabpanel=1 |
| 655 | END |
| 656 | call writefile(lines, 'XTest_tabpanel_ruler', 'D') |
| 657 | |
| 658 | let buf = RunVimInTerminal('-S XTest_tabpanel_ruler', {'rows': 10, 'cols': 45}) |
| 659 | call VerifyScreenDump(buf, 'Test_tabpanel_ruler_0', {}) |
| 660 | |
| 661 | call StopVimInTerminal(buf) |
| 662 | endfunc |
| 663 | |
Christian Brabandt | a88c5bd | 2025-05-26 19:51:03 +0200 | [diff] [blame] | 664 | function Test_tabpanel_error() |
| 665 | set tabpanel=%!NonExistingFunc() |
| 666 | try |
| 667 | set showtabpanel=2 |
| 668 | redraw! |
| 669 | catch /^Vim\%((\a\+)\)\=:E117:/ |
| 670 | endtry |
| 671 | call assert_true(empty(&tabpanel)) |
Christian Brabandt | ac83b3c | 2025-05-27 20:49:34 +0200 | [diff] [blame] | 672 | |
| 673 | try |
| 674 | set tabpanel=%{my#util#TabPanelHighlight}%t |
| 675 | redraw! |
| 676 | catch /^Vim\%((\a\+)\)\=:E121:/ |
| 677 | endtry |
| 678 | call assert_true(empty(&tabpanel)) |
| 679 | |
Christian Brabandt | a88c5bd | 2025-05-26 19:51:03 +0200 | [diff] [blame] | 680 | set tabpanel&vim |
| 681 | set showtabpanel&vim |
| 682 | endfunc |
Hirohito Higashi | 3ca6776 | 2025-06-10 20:19:04 +0200 | [diff] [blame] | 683 | |
| 684 | function Test_tabpanel_with_msg_scrolled() |
| 685 | CheckScreendump |
| 686 | |
| 687 | let lines =<< trim END |
| 688 | set showtabpanel=2 |
| 689 | set noruler |
| 690 | tabnew |
| 691 | set modified |
| 692 | tabfirst |
| 693 | END |
| 694 | call writefile(lines, 'XTest_tabpanel_with_msg_scrolled', 'D') |
| 695 | |
| 696 | let buf = RunVimInTerminal('-S XTest_tabpanel_with_msg_scrolled', {'rows': 10, 'cols': 45}) |
| 697 | call VerifyScreenDump(buf, 'Test_tabpanel_with_msg_scrolled_0', {}) |
| 698 | call term_sendkeys(buf, ":qa\<CR>") |
| 699 | call term_sendkeys(buf, "\<CR>") |
| 700 | call VerifyScreenDump(buf, 'Test_tabpanel_with_msg_scrolled_1', {}) |
| 701 | |
| 702 | call StopVimInTerminal(buf) |
| 703 | endfunc |
Hirohito Higashi | e5c96e3 | 2025-06-16 19:39:24 +0200 | [diff] [blame] | 704 | |
| 705 | function Test_tabpanel_with_cmdline_pum() |
| 706 | CheckScreendump |
| 707 | |
| 708 | let lines =<< trim END |
| 709 | set showtabpanel=2 |
| 710 | set noruler |
| 711 | tabnew aaa |
| 712 | set wildoptions+=pum |
| 713 | func TimerCb(timer) |
| 714 | tabnew bbb |
| 715 | endfunc |
| 716 | call timer_start(100, 'TimerCb') |
| 717 | END |
| 718 | call writefile(lines, 'XTest_tabpanel_with_cmdline_pum', 'D') |
| 719 | |
| 720 | let buf = RunVimInTerminal('-S XTest_tabpanel_with_cmdline_pum', {'rows': 10, 'cols': 45}) |
| 721 | call term_sendkeys(buf, "\<C-L>") |
| 722 | call VerifyScreenDump(buf, 'Test_tabpanel_with_cmdline_pum_0', {}) |
| 723 | call term_sendkeys(buf, ":set\<Tab>") |
| 724 | call term_wait(buf, 120) |
| 725 | call VerifyScreenDump(buf, 'Test_tabpanel_with_cmdline_pum_1', {}) |
| 726 | call term_sendkeys(buf, "\<Esc>:tabclose\<CR>\<C-L>") |
| 727 | call VerifyScreenDump(buf, 'Test_tabpanel_with_cmdline_pum_0', {}) |
| 728 | |
| 729 | call StopVimInTerminal(buf) |
| 730 | endfunc |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 731 | " vim: shiftwidth=2 sts=2 expandtab |