comparison src/testdir/test_textprop.vim @ 30261:6b658ef69e93 v9.0.0466

patch 9.0.0466: virtual text wrong after adding line break after line Commit: https://github.com/vim/vim/commit/ebd0e8bb853cb744b60bf4f57011c4379ae4aaed Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 14 22:13:59 2022 +0100 patch 9.0.0466: virtual text wrong after adding line break after line Problem: Virtual text wrong after adding line break after line. Solution: Pass an "eol" flag to where text properties are adjusted. (closes #11131)
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Sep 2022 23:15:03 +0200
parents 45788c16b3a5
children 5f112a0b4da1
comparison
equal deleted inserted replaced
30260:742a12140d60 30261:6b658ef69e93
2906 2906
2907 bwipe! 2907 bwipe!
2908 call prop_type_delete('indented') 2908 call prop_type_delete('indented')
2909 endfunc 2909 endfunc
2910 2910
2911 func Test_prop_below_split_line()
2912 CheckRunVimInTerminal
2913
2914 let lines =<< trim END
2915 vim9script
2916 setline(1, ['one one one', 'two two two', 'three three three'])
2917 prop_type_add('test', {highlight: 'ModeMsg'})
2918 prop_add(2, 0, {
2919 text: '└─ Virtual text below the 2nd line',
2920 type: 'test',
2921 text_align: 'below',
2922 text_padding_left: 3
2923 })
2924 END
2925 call writefile(lines, 'XscriptPropBelowSpitLine', 'D')
2926 let buf = RunVimInTerminal('-S XscriptPropBelowSpitLine', #{rows: 8})
2927 call term_sendkeys(buf, "2GA\<CR>xx")
2928 call VerifyScreenDump(buf, 'Test_prop_below_split_line_1', {})
2929
2930 call term_sendkeys(buf, "\<Esc>")
2931 call StopVimInTerminal(buf)
2932 endfunc
2933
2911 func Test_props_with_text_override() 2934 func Test_props_with_text_override()
2912 CheckRunVimInTerminal 2935 CheckRunVimInTerminal
2913 2936
2914 let lines =<< trim END 2937 let lines =<< trim END
2915 vim9script 2938 vim9script
2918 prop_type_add('prop', {highlight: 'Likethis', override: true}) 2941 prop_type_add('prop', {highlight: 'Likethis', override: true})
2919 prop_add(1, 6, {type: 'prop', text: ' inserted '}) 2942 prop_add(1, 6, {type: 'prop', text: ' inserted '})
2920 hi CursorLine cterm=underline ctermbg=lightgrey 2943 hi CursorLine cterm=underline ctermbg=lightgrey
2921 set cursorline 2944 set cursorline
2922 END 2945 END
2923 call writefile(lines, 'XscriptPropsOverride') 2946 call writefile(lines, 'XscriptPropsOverride', 'D')
2924 let buf = RunVimInTerminal('-S XscriptPropsOverride', #{rows: 6, cols: 60}) 2947 let buf = RunVimInTerminal('-S XscriptPropsOverride', #{rows: 6, cols: 60})
2925 call VerifyScreenDump(buf, 'Test_prop_with_text_override_1', {}) 2948 call VerifyScreenDump(buf, 'Test_prop_with_text_override_1', {})
2926 2949
2927 call term_sendkeys(buf, ":set nocursorline\<CR>") 2950 call term_sendkeys(buf, ":set nocursorline\<CR>")
2928 call term_sendkeys(buf, "0llvfr") 2951 call term_sendkeys(buf, "0llvfr")
2929 call VerifyScreenDump(buf, 'Test_prop_with_text_override_2', {}) 2952 call VerifyScreenDump(buf, 'Test_prop_with_text_override_2', {})
2930 2953
2931 call StopVimInTerminal(buf) 2954 call StopVimInTerminal(buf)
2932 call delete('XscriptPropsOverride')
2933 endfunc 2955 endfunc
2934 2956
2935 func Test_props_with_text_CursorMoved() 2957 func Test_props_with_text_CursorMoved()
2936 CheckRunVimInTerminal 2958 CheckRunVimInTerminal
2937 2959