Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
29917:a25eab5e4117 | 29918:e6e0f1c39edb |
---|---|
2572 func Test_props_with_text_right_align_twice() | 2572 func Test_props_with_text_right_align_twice() |
2573 CheckRunVimInTerminal | 2573 CheckRunVimInTerminal |
2574 | 2574 |
2575 let lines =<< trim END | 2575 let lines =<< trim END |
2576 call setline(1, ["some text some text some text some text", 'line two']) | 2576 call setline(1, ["some text some text some text some text", 'line two']) |
2577 call prop_type_add( 'MyErrorText', #{ highlight: 'ErrorMsg' } ) | 2577 call prop_type_add('MyErrorText', #{ highlight: 'ErrorMsg'}) |
2578 call prop_type_add( 'MyPadding', #{ highlight: 'DiffChange' } ) | 2578 call prop_type_add('MyPadding', #{ highlight: 'DiffChange'}) |
2579 call prop_add( 1, 0, #{ type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'} ) | 2579 call prop_add(1, 0, #{type: 'MyPadding', text: ' nothing here', text_wrap: 'wrap'}) |
2580 call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right' } ) | 2580 call prop_add(1, 0, #{type: 'MyErrorText', text: 'Some error', text_wrap: 'wrap', text_align: 'right'}) |
2581 call prop_add( 1, 0, #{ type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right' } ) | 2581 call prop_add(1, 0, #{type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right'}) |
2582 normal G$ | 2582 normal G$ |
2583 END | 2583 END |
2584 call writefile(lines, 'XscriptPropsRightAlign') | 2584 call writefile(lines, 'XscriptPropsRightAlign') |
2585 let buf = RunVimInTerminal('-S XscriptPropsRightAlign', #{rows: 8}) | 2585 let buf = RunVimInTerminal('-S XscriptPropsRightAlign', #{rows: 8}) |
2586 call VerifyScreenDump(buf, 'Test_prop_right_align_twice_1', {}) | 2586 call VerifyScreenDump(buf, 'Test_prop_right_align_twice_1', {}) |
2587 | 2587 |
2588 call term_sendkeys(buf, "ggisome more text\<Esc>G$") | 2588 call term_sendkeys(buf, "ggisome more text\<Esc>G$") |
2589 call VerifyScreenDump(buf, 'Test_prop_right_align_twice_2', {}) | 2589 call VerifyScreenDump(buf, 'Test_prop_right_align_twice_2', {}) |
2590 | |
2591 call term_sendkeys(buf, ":set signcolumn=yes\<CR>") | |
2592 call VerifyScreenDump(buf, 'Test_prop_right_align_twice_3', {}) | |
2590 | 2593 |
2591 call StopVimInTerminal(buf) | 2594 call StopVimInTerminal(buf) |
2592 call delete('XscriptPropsRightAlign') | 2595 call delete('XscriptPropsRightAlign') |
2593 endfunc | 2596 endfunc |
2594 | 2597 |