Mercurial > vim
comparison src/testdir/test_textprop.vim @ 29816:bbe62ea78aac v9.0.0247
patch 9.0.0247: cannot add padding to virtual text without highlight
Commit: https://github.com/vim/vim/commit/f396ce83eebf6c61596184231d39ce4d41eeac04
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 23 18:39:37 2022 +0100
patch 9.0.0247: cannot add padding to virtual text without highlight
Problem: Cannot add padding to virtual text without highlight.
Solution: Add the "text_padding_left" argument. (issue https://github.com/vim/vim/issues/10906)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 23 Aug 2022 19:45:05 +0200 |
parents | d08aa1bfe319 |
children | bfd08e50e2c0 |
comparison
equal
deleted
inserted
replaced
29815:9941dc321348 | 29816:bbe62ea78aac |
---|---|
3039 | 3039 |
3040 call StopVimInTerminal(buf) | 3040 call StopVimInTerminal(buf) |
3041 call delete('XscriptPropsListMode') | 3041 call delete('XscriptPropsListMode') |
3042 endfunc | 3042 endfunc |
3043 | 3043 |
3044 func Test_insert_text_with_padding() | |
3045 CheckRunVimInTerminal | |
3046 | |
3047 let lines =<< trim END | |
3048 vim9script | |
3049 setline(1, ['Some text to add virtual text to.', | |
3050 'second line', | |
3051 'Another line with some text to make the wrap.']) | |
3052 prop_type_add('theprop', {highlight: 'DiffChange'}) | |
3053 prop_add(1, 0, { | |
3054 type: 'theprop', | |
3055 text: 'after', | |
3056 text_align: 'after', | |
3057 text_padding_left: 3, | |
3058 }) | |
3059 prop_add(1, 0, { | |
3060 type: 'theprop', | |
3061 text: 'right aligned', | |
3062 text_align: 'right', | |
3063 text_padding_left: 5, | |
3064 }) | |
3065 prop_add(1, 0, { | |
3066 type: 'theprop', | |
3067 text: 'below the line', | |
3068 text_align: 'below', | |
3069 text_padding_left: 4, | |
3070 }) | |
3071 prop_add(3, 0, { | |
3072 type: 'theprop', | |
3073 text: 'rightmost', | |
3074 text_align: 'right', | |
3075 text_padding_left: 6, | |
3076 text_wrap: 'wrap', | |
3077 }) | |
3078 END | |
3079 call writefile(lines, 'XscriptPropsPadded') | |
3080 let buf = RunVimInTerminal('-S XscriptPropsPadded', #{rows: 8, cols: 60}) | |
3081 call VerifyScreenDump(buf, 'Test_prop_text_with_padding_1', {}) | |
3082 | |
3083 call term_sendkeys(buf, "ggixxxxxxxxxx\<Esc>") | |
3084 call term_sendkeys(buf, "3Gix\<Esc>") | |
3085 call VerifyScreenDump(buf, 'Test_prop_text_with_padding_2', {}) | |
3086 | |
3087 call term_sendkeys(buf, "ggix\<Esc>") | |
3088 call VerifyScreenDump(buf, 'Test_prop_text_with_padding_3', {}) | |
3089 | |
3090 call StopVimInTerminal(buf) | |
3091 call delete('XscriptPropsPadded') | |
3092 endfunc | |
3093 | |
3044 " vim: shiftwidth=2 sts=2 expandtab | 3094 " vim: shiftwidth=2 sts=2 expandtab |