diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-28 16:39:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-28 16:39:22 +0100 |
commit | c8bf59e9b27f9d621818ffc61468abef45cedf37 (patch) | |
tree | b6fd429cf210b44096b647b6cd6c04dbfcedc6da /src/testdir | |
parent | 35a4fbc5d04820d9b08e7da2e295a7e8210e2e2c (diff) |
patch 9.0.0297: cursor position wrong after right aligned virtual textv9.0.0297
Problem: Cursor position wrong after right aligned virtual text. (Iizuka
Masashi)
Solution: Take the width of the column offset into account. (closes #10997)
Also fix virtual text positioning.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_prop_right_align_twice_3.dump | 8 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 13 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/testdir/dumps/Test_prop_right_align_twice_3.dump b/src/testdir/dumps/Test_prop_right_align_twice_3.dump new file mode 100644 index 0000000000..2c4cbeee54 --- /dev/null +++ b/src/testdir/dumps/Test_prop_right_align_twice_3.dump @@ -0,0 +1,8 @@ +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e| |m|o|r|e| |t|e|x|t|s|o|m|e| |t|e|x|t| |s|o|m|e| |t|e|x|t| |s|o|m|e| |t|e|x|t| |s|o|m|e| |t|e|x|t| +0&#ffd7ff255|n|o|t|h|i|n|g| |h|e|r|e| +0&#ffffff0@6 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@62|S+0#ffffff16#e000002|o|m|e| |e|r@1|o|r +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@59|A+0#ffffff16#e000002|n|o|t|h|e|r| |e|r@1|o|r +| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|i|n|e| |t|w>o| @64 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|2|,|8| @10|A|l@1| diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index 60bf48c12a..7a2fcf6111 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2574,11 +2574,11 @@ func Test_props_with_text_right_align_twice() let lines =<< trim END call setline(1, ["some text some text some text some text", 'line two']) - call prop_type_add( 'MyErrorText', #{ highlight: 'ErrorMsg' } ) - call prop_type_add( 'MyPadding', #{ highlight: 'DiffChange' } ) - call prop_add( 1, 0, #{ type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'} ) - call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right' } ) - call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right' } ) + call prop_type_add('MyErrorText', #{ highlight: 'ErrorMsg'}) + call prop_type_add('MyPadding', #{ highlight: 'DiffChange'}) + call prop_add(1, 0, #{type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'}) + call prop_add(1, 0, #{type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right'}) + call prop_add(1, 0, #{type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right'}) normal G$ END call writefile(lines, 'XscriptPropsRightAlign') @@ -2588,6 +2588,9 @@ func Test_props_with_text_right_align_twice() call term_sendkeys(buf, "ggisome more text\<Esc>G$") call VerifyScreenDump(buf, 'Test_prop_right_align_twice_2', {}) + call term_sendkeys(buf, ":set signcolumn=yes\<CR>") + call VerifyScreenDump(buf, 'Test_prop_right_align_twice_3', {}) + call StopVimInTerminal(buf) call delete('XscriptPropsRightAlign') endfunc |