diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-14 13:28:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-14 13:28:55 +0100 |
commit | 28c9f895716cfa8f1220bc41b72a534c0e10cabe (patch) | |
tree | 274ccf5d35445ce4b46e733b209fb73edcf4ad0c /src/testdir/test_textprop.vim | |
parent | 63acae13f57c5ad4c8ec3146d0c458550b9e984e (diff) | |
download | vim-git-28c9f895716cfa8f1220bc41b72a534c0e10cabe.tar.gz |
patch 9.0.0205: cursor in wrong position when inserting after virtual textv9.0.0205
Problem: Cursor in wrong position when inserting after virtual text. (Ben
Jackson)
Solution: Put the cursor after the virtual text, where the text will be
inserted. (closes #10914)
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r-- | src/testdir/test_textprop.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index b702340a3..2e72db9b9 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2914,4 +2914,35 @@ def Test_insert_text_before_virtual_text() bwipe! enddef +func Test_insert_text_start_incl() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + setline(1, 'text one text two') + + prop_type_add('propincl', {highlight: 'NonText', start_incl: true}) + prop_add(1, 6, {type: 'propincl', text: 'after '}) + cursor(1, 6) + prop_type_add('propnotincl', {highlight: 'NonText', start_incl: false}) + prop_add(1, 15, {type: 'propnotincl', text: 'before '}) + END + call writefile(lines, 'XscriptPropsStartIncl') + let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60}) + call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_1', {}) + + call term_sendkeys(buf, "i") + call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_2', {}) + call term_sendkeys(buf, "xx\<Esc>") + call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_3', {}) + + call term_sendkeys(buf, "2wi") + call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_4', {}) + call term_sendkeys(buf, "yy\<Esc>") + call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_5', {}) + + call StopVimInTerminal(buf) + call delete('XscriptPropsStartIncl') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |