Mercurial > vim
diff src/testdir/test_textprop.vim @ 29918:e6e0f1c39edb v9.0.0297
patch 9.0.0297: cursor position wrong after right aligned virtual text
Commit: https://github.com/vim/vim/commit/c8bf59e9b27f9d621818ffc61468abef45cedf37
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 28 16:39:22 2022 +0100
patch 9.0.0297: cursor position wrong after right aligned virtual text
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Aug 2022 17:45:03 +0200 |
parents | bfd08e50e2c0 |
children | 86eb4aba16c3 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2574,11 +2574,11 @@ func Test_props_with_text_right_align_tw 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_tw 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