Mercurial > vim
diff src/testdir/test_listlbr.vim @ 30725:1cbb01bc75c3 v9.0.0697
patch 9.0.0697: cursor in wrong position with Visual substitute
Commit: https://github.com/vim/vim/commit/16dab41537ae206f4cab676ad53edbae5fd5fb45
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 8 16:41:32 2022 +0100
patch 9.0.0697: cursor in wrong position with Visual substitute
Problem: Cursor in wrong position with Visual substitute.
Solution: When restoring 'linebreak' mark the virtual column as invalid.
(closes #11309, closes #11311)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Oct 2022 17:45:04 +0200 |
parents | 218363931f5d |
children | 09a61a174259 |
line wrap: on
line diff
--- a/src/testdir/test_listlbr.vim +++ b/src/testdir/test_listlbr.vim @@ -8,6 +8,7 @@ CheckOption linebreak CheckFeature conceal source view_util.vim +source screendump.vim function s:screen_lines(lnum, width) abort return ScreenLines(a:lnum, a:width) @@ -133,6 +134,26 @@ func Test_linebreak_with_visual_operatio call s:close_windows() endfunc +func Test_linebreak_reset_restore() + CheckScreendump + + let lines =<< trim END + vim9script + &linebreak = true + &showcmd = true + &showmode = false + ('a'->repeat(&columns - 10) .. ' ' .. 'b'->repeat(10) .. ' c')->setline(1) + END + call writefile(lines, 'XlbrResetRestore', 'D') + let buf = RunVimInTerminal('-S XlbrResetRestore', {'rows': 8}) + + call term_sendkeys(buf, '$v$s') + call VerifyScreenDump(buf, 'Test_linebreak_reset_restore_1', {}) + + call term_sendkeys(buf, "\<Esc>") + call StopVimInTerminal(buf) +endfunc + func Test_virtual_block() call s:test_windows('setl sbr=+') call setline(1, [