Mercurial > vim
diff src/testdir/test_textprop.vim @ 29585:e357bc89bb95 v9.0.0133
patch 9.0.0133: virtual text after line moves to joined line
Commit: https://github.com/vim/vim/commit/e175dc6911948bcd0c854876b534fee62fb95b9f
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 1 22:18:50 2022 +0100
patch 9.0.0133: virtual text after line moves to joined line
Problem: Virtual text after line moves to joined line. (Yegappan
Lakshmanan)
Solution: When joining lines only keep virtual text after the last line.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 01 Aug 2022 23:30:03 +0200 |
parents | 32aee589fc9a |
children | d70f588baaa1 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2243,6 +2243,32 @@ func Test_props_with_text_after() call delete('XscriptPropsWithTextAfter') endfunc +func Test_props_with_text_after_joined() + CheckRunVimInTerminal + + let lines =<< trim END + call setline(1, ['one', 'two', 'three', 'four']) + call prop_type_add('afterprop', #{highlight: 'Search'}) + call prop_add(1, 0, #{type: 'afterprop', text: ' ONE', text_align: 'after'}) + call prop_add(4, 0, #{type: 'afterprop', text: ' FOUR', text_align: 'after'}) + normal ggJ + normal GkJ + + call setline(3, ['a', 'b', 'c', 'd', 'e', 'f']) + call prop_add(3, 0, #{type: 'afterprop', text: ' AAA', text_align: 'after'}) + call prop_add(5, 0, #{type: 'afterprop', text: ' CCC', text_align: 'after'}) + call prop_add(7, 0, #{type: 'afterprop', text: ' EEE', text_align: 'after'}) + call prop_add(8, 0, #{type: 'afterprop', text: ' FFF', text_align: 'after'}) + normal 3G6J + END + call writefile(lines, 'XscriptPropsWithTextAfterJoined') + let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterJoined', #{rows: 6, cols: 60}) + call VerifyScreenDump(buf, 'Test_prop_with_text_after_joined_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptPropsWithTextAfterJoined') +endfunc + func Test_removed_prop_with_text_cleans_up_array() new call setline(1, 'some text here')