Mercurial > vim
comparison src/testdir/test_matchadd_conceal.vim @ 18621:a9bfdc5ea1ec v8.1.2303
patch 8.1.2303: cursor in wrong position after horizontal scroll
Commit: https://github.com/vim/vim/commit/08f23636aef595f4cc061dfee8248dca97df16b3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 16 14:19:33 2019 +0100
patch 8.1.2303: cursor in wrong position after horizontal scroll
Problem: Cursor in wrong position after horizontal scroll.
Solution: Set w_valid_leftcol. (closes https://github.com/vim/vim/issues/5214, closes https://github.com/vim/vim/issues/5224)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 16 Nov 2019 14:30:03 +0100 |
parents | e4b03b369c41 |
children | 7882ccab03da |
comparison
equal
deleted
inserted
replaced
18620:f05453714d16 | 18621:a9bfdc5ea1ec |
---|---|
314 call assert_equal(2, term_getcursor(buf)[1]) | 314 call assert_equal(2, term_getcursor(buf)[1]) |
315 | 315 |
316 call StopVimInTerminal(buf) | 316 call StopVimInTerminal(buf) |
317 call delete('Xcolesearch') | 317 call delete('Xcolesearch') |
318 endfunc | 318 endfunc |
319 | |
320 func Test_cursor_column_in_concealed_line_after_leftcol_change() | |
321 CheckRunVimInTerminal | |
322 | |
323 " Test for issue #5214 fix. | |
324 let lines =<< trim END | |
325 0put = 'ab' .. repeat('-', &columns) .. 'c' | |
326 call matchadd('Conceal', '-') | |
327 set nowrap ss=0 cole=3 cocu=n | |
328 END | |
329 call writefile(lines, 'Xcurs-columns') | |
330 let buf = RunVimInTerminal('-S Xcurs-columns', {}) | |
331 | |
332 " Go to the end of the line (3 columns beyond the end of the screen). | |
333 " Horizontal scroll would center the cursor in the screen line, but conceal | |
334 " makes it go to screen column 1. | |
335 call term_sendkeys(buf, "$") | |
336 call term_wait(buf) | |
337 | |
338 " Are the concealed parts of the current line really hidden? | |
339 call assert_equal('c', term_getline(buf, '.')) | |
340 | |
341 " BugFix check: Is the window's cursor column properly updated for conceal? | |
342 call assert_equal(1, term_getcursor(buf)[1]) | |
343 | |
344 call StopVimInTerminal(buf) | |
345 call delete('Xcurs-columns') | |
346 endfunc |