Mercurial > vim
comparison src/testdir/test_scroll_opt.vim @ 31127:92b929203a4f v9.0.0898
patch 9.0.0898: with 'smoothscroll' cursor is one screen line too far down
Commit: https://github.com/vim/vim/commit/75ac25b4967cdcdfdf2d6c086a6e2308868c280a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 17 19:00:14 2022 +0000
patch 9.0.0898: with 'smoothscroll' cursor is one screen line too far down
Problem: With 'smoothscroll' cursor is one screen line too far down. (Ernie
Rael)
Solution: Add a test that currently has the wrong result so that a fix can
be made. (issue #11436)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Nov 2022 20:15:06 +0100 |
parents | a5bf86083558 |
children | 8de082110e2d |
comparison
equal
deleted
inserted
replaced
31126:9f8f5c88f157 | 31127:92b929203a4f |
---|---|
306 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) | 306 call VerifyScreenDump(buf, 'Test_smooth_one_long_1', {}) |
307 | 307 |
308 call StopVimInTerminal(buf) | 308 call StopVimInTerminal(buf) |
309 endfunc | 309 endfunc |
310 | 310 |
311 func Test_smoothscroll_long_line_showbreak() | |
312 CheckScreendump | |
313 | |
314 let lines =<< trim END | |
315 vim9script | |
316 # a line that spans four screen lines | |
317 setline(1, 'with lots of text in one line '->repeat(6)) | |
318 set smoothscroll scrolloff=0 showbreak=+++\ | |
319 END | |
320 call writefile(lines, 'XSmoothLongShowbreak', 'D') | |
321 let buf = RunVimInTerminal('-S XSmoothLongShowbreak', #{rows: 6, cols: 40}) | |
322 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) | |
323 | |
324 " FIXME: this currently has the cursor in screen line 2, should be one up. | |
325 call term_sendkeys(buf, "\<C-E>") | |
326 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_2', {}) | |
327 | |
328 call term_sendkeys(buf, "0") | |
329 call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) | |
330 | |
331 call StopVimInTerminal(buf) | |
332 endfunc | |
333 | |
311 " Test that if the current cursor is on a smooth scrolled line, we correctly | 334 " Test that if the current cursor is on a smooth scrolled line, we correctly |
312 " reposition it. Also check that we don't miscalculate the values by checking | 335 " reposition it. Also check that we don't miscalculate the values by checking |
313 " the consistency between wincol() and col('.') as they are calculated | 336 " the consistency between wincol() and col('.') as they are calculated |
314 " separately in code. | 337 " separately in code. |
315 func Test_smoothscroll_cursor_position() | 338 func Test_smoothscroll_cursor_position() |