Mercurial > vim
comparison src/testdir/test_textprop.vim @ 30773:fc9993c5835a v9.0.0721
patch 9.0.0721: virtual text "above" with padding not displayed correctly
Commit: https://github.com/vim/vim/commit/9466fb8001227a4bc9045e91045426bc40680366
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 11 14:54:42 2022 +0100
patch 9.0.0721: virtual text "above" with padding not displayed correctly
Problem: Virtual text "above" with padding not displayed correctly.
Solution: Take padding into account when truncating. (closes https://github.com/vim/vim/issues/11340)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 11 Oct 2022 16:00:05 +0200 |
parents | 5dba398584fd |
children | a9a46fbfd786 |
comparison
equal
deleted
inserted
replaced
30772:73a1f2dec989 | 30773:fc9993c5835a |
---|---|
2850 | 2850 |
2851 normal gglllj | 2851 normal gglllj |
2852 func AddPropBelow() | 2852 func AddPropBelow() |
2853 call prop_add(1, 0, #{type: 'below', text: 'below', text_align: 'below'}) | 2853 call prop_add(1, 0, #{type: 'below', text: 'below', text_align: 'below'}) |
2854 endfunc | 2854 endfunc |
2855 func AddLongPropAbove() | |
2856 3,4delete | |
2857 set wrap | |
2858 call prop_add(1, 0, #{type: 'above1', text: range(50)->join(' '), text_align: 'above', text_padding_left: 2}) | |
2859 endfunc | |
2855 END | 2860 END |
2856 call writefile(lines, 'XscriptPropsWithTextAbove', 'D') | 2861 call writefile(lines, 'XscriptPropsWithTextAbove', 'D') |
2857 let buf = RunVimInTerminal('-S XscriptPropsWithTextAbove', #{rows: 9, cols: 60}) | 2862 let buf = RunVimInTerminal('-S XscriptPropsWithTextAbove', #{rows: 9, cols: 60}) |
2858 call VerifyScreenDump(buf, 'Test_prop_with_text_above_1', {}) | 2863 call VerifyScreenDump(buf, 'Test_prop_with_text_above_1', {}) |
2859 | 2864 |
2884 call term_sendkeys(buf, "V") | 2889 call term_sendkeys(buf, "V") |
2885 call VerifyScreenDump(buf, 'Test_prop_with_text_above_7', {}) | 2890 call VerifyScreenDump(buf, 'Test_prop_with_text_above_7', {}) |
2886 | 2891 |
2887 call term_sendkeys(buf, "\<Esc>ls\<CR>\<Esc>") | 2892 call term_sendkeys(buf, "\<Esc>ls\<CR>\<Esc>") |
2888 call VerifyScreenDump(buf, 'Test_prop_with_text_above_8', {}) | 2893 call VerifyScreenDump(buf, 'Test_prop_with_text_above_8', {}) |
2894 | |
2895 call term_sendkeys(buf, ":call AddLongPropAbove()\<CR>") | |
2896 call VerifyScreenDump(buf, 'Test_prop_with_text_above_9', {}) | |
2889 | 2897 |
2890 call StopVimInTerminal(buf) | 2898 call StopVimInTerminal(buf) |
2891 endfunc | 2899 endfunc |
2892 | 2900 |
2893 func Test_prop_above_with_indent() | 2901 func Test_prop_above_with_indent() |