Mercurial > vim
comparison src/testdir/test_scroll_opt.vim @ 31849:dbec60b8c253 v9.0.1257
patch 9.0.1257: code style is not check in test scripts
Commit: https://github.com/vim/vim/commit/94722c510745a0cfd494c51625a514b92dd2bfb2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 28 19:19:03 2023 +0000
patch 9.0.1257: code style is not check in test scripts
Problem: Code style is not check in test scripts.
Solution: Add basic code style check for test files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 28 Jan 2023 20:30:04 +0100 |
parents | 2a590b4a3fba |
children | d8fdafc4b390 |
comparison
equal
deleted
inserted
replaced
31848:b83cac410fcf | 31849:dbec60b8c253 |
---|---|
269 | 269 |
270 " 'scrolloff' set to 1, scrolling up, cursor moves screen line down | 270 " 'scrolloff' set to 1, scrolling up, cursor moves screen line down |
271 call term_sendkeys(buf, ":set scrolloff=1\<CR>") | 271 call term_sendkeys(buf, ":set scrolloff=1\<CR>") |
272 call term_sendkeys(buf, "10|\<C-E>") | 272 call term_sendkeys(buf, "10|\<C-E>") |
273 call VerifyScreenDump(buf, 'Test_smooth_long_6', {}) | 273 call VerifyScreenDump(buf, 'Test_smooth_long_6', {}) |
274 | 274 |
275 " 'scrolloff' set to 1, scrolling down, cursor moves screen line up | 275 " 'scrolloff' set to 1, scrolling down, cursor moves screen line up |
276 call term_sendkeys(buf, "\<C-E>") | 276 call term_sendkeys(buf, "\<C-E>") |
277 call term_sendkeys(buf, "gjgj") | 277 call term_sendkeys(buf, "gjgj") |
278 call term_sendkeys(buf, "\<C-Y>") | 278 call term_sendkeys(buf, "\<C-Y>") |
279 call VerifyScreenDump(buf, 'Test_smooth_long_7', {}) | 279 call VerifyScreenDump(buf, 'Test_smooth_long_7', {}) |
280 | 280 |
281 " 'scrolloff' set to 2, scrolling up, cursor moves screen line down | 281 " 'scrolloff' set to 2, scrolling up, cursor moves screen line down |
282 call term_sendkeys(buf, ":set scrolloff=2\<CR>") | 282 call term_sendkeys(buf, ":set scrolloff=2\<CR>") |
283 call term_sendkeys(buf, "10|\<C-E>") | 283 call term_sendkeys(buf, "10|\<C-E>") |
284 call VerifyScreenDump(buf, 'Test_smooth_long_8', {}) | 284 call VerifyScreenDump(buf, 'Test_smooth_long_8', {}) |
285 | 285 |
286 " 'scrolloff' set to 2, scrolling down, cursor moves screen line up | 286 " 'scrolloff' set to 2, scrolling down, cursor moves screen line up |
287 call term_sendkeys(buf, "\<C-E>") | 287 call term_sendkeys(buf, "\<C-E>") |
288 call term_sendkeys(buf, "gj") | 288 call term_sendkeys(buf, "gj") |
289 call term_sendkeys(buf, "\<C-Y>") | 289 call term_sendkeys(buf, "\<C-Y>") |
290 call VerifyScreenDump(buf, 'Test_smooth_long_9', {}) | 290 call VerifyScreenDump(buf, 'Test_smooth_long_9', {}) |
318 " still end up scrolling down to the next line with cursor at bottom of | 318 " still end up scrolling down to the next line with cursor at bottom of |
319 " screen. | 319 " screen. |
320 call term_sendkeys(buf, "3Gzt") | 320 call term_sendkeys(buf, "3Gzt") |
321 call term_sendkeys(buf, "\<C-E>j") | 321 call term_sendkeys(buf, "\<C-E>j") |
322 call VerifyScreenDump(buf, 'Test_smooth_long_15', {}) | 322 call VerifyScreenDump(buf, 'Test_smooth_long_15', {}) |
323 | 323 |
324 call StopVimInTerminal(buf) | 324 call StopVimInTerminal(buf) |
325 endfunc | 325 endfunc |
326 | 326 |
327 func Test_smoothscroll_one_long_line() | 327 func Test_smoothscroll_one_long_line() |
328 CheckScreendump | 328 CheckScreendump |
333 set smoothscroll scrolloff=0 | 333 set smoothscroll scrolloff=0 |
334 END | 334 END |
335 call writefile(lines, 'XSmoothOneLong', 'D') | 335 call writefile(lines, 'XSmoothOneLong', 'D') |
336 let buf = RunVimInTerminal('-S XSmoothOneLong', #{rows: 6, cols: 40}) | 336 let buf = RunVimInTerminal('-S XSmoothOneLong', #{rows: 6, cols: 40}) |
337 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) | 337 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) |
338 | 338 |
339 call term_sendkeys(buf, "\<C-E>") | 339 call term_sendkeys(buf, "\<C-E>") |
340 call VerifyScreenDump(buf, 'Test_smooth_one_long_2', {}) | 340 call VerifyScreenDump(buf, 'Test_smooth_one_long_2', {}) |
341 | 341 |
342 call term_sendkeys(buf, "0") | 342 call term_sendkeys(buf, "0") |
343 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) | 343 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) |
355 set smoothscroll scrolloff=0 showbreak=+++\ | 355 set smoothscroll scrolloff=0 showbreak=+++\ |
356 END | 356 END |
357 call writefile(lines, 'XSmoothLongShowbreak', 'D') | 357 call writefile(lines, 'XSmoothLongShowbreak', 'D') |
358 let buf = RunVimInTerminal('-S XSmoothLongShowbreak', #{rows: 6, cols: 40}) | 358 let buf = RunVimInTerminal('-S XSmoothLongShowbreak', #{rows: 6, cols: 40}) |
359 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) | 359 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) |
360 | 360 |
361 call term_sendkeys(buf, "\<C-E>") | 361 call term_sendkeys(buf, "\<C-E>") |
362 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_2', {}) | 362 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_2', {}) |
363 | 363 |
364 call term_sendkeys(buf, "0") | 364 call term_sendkeys(buf, "0") |
365 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) | 365 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) |
463 | 463 |
464 func Test_smoothscroll_cursor_scrolloff() | 464 func Test_smoothscroll_cursor_scrolloff() |
465 call NewWindow(10, 20) | 465 call NewWindow(10, 20) |
466 setl smoothscroll wrap | 466 setl smoothscroll wrap |
467 setl scrolloff=3 | 467 setl scrolloff=3 |
468 | 468 |
469 " 120 chars are 6 screen lines | 469 " 120 chars are 6 screen lines |
470 call setline(1, "abcdefghijklmnopqrstABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrstABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrstABCDEFGHIJKLMNOPQRST") | 470 call setline(1, "abcdefghijklmnopqrstABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrstABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrstABCDEFGHIJKLMNOPQRST") |
471 call setline(2, "below") | 471 call setline(2, "below") |
472 | 472 |
473 call s:check_col_calc(1, 1, 1) | 473 call s:check_col_calc(1, 1, 1) |