comparison src/testdir/test_textprop.vim @ 30763:8ea77a6ceff0 v9.0.0716

patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left Commit: https://github.com/vim/vim/commit/cd105417a53fcf97c0935f3468201ef11516c9f1 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 10 19:50:42 2022 +0100 patch 9.0.0716: with 'nowrap' virtual text "after" does not scroll left Problem: With 'nowrap' virtual text "after" does not scroll left. Solution: Skip part of the virtual text that is left of the window. (closes #11320) Fix going beyond the last column of the window.
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Oct 2022 21:00:05 +0200
parents b41ccaa6fd84
children 5dba398584fd
comparison
equal deleted inserted replaced
30762:df5ddde37685 30763:8ea77a6ceff0
3212 endfunc 3212 endfunc
3213 3213
3214 func Test_text_after_nowrap() 3214 func Test_text_after_nowrap()
3215 CheckRunVimInTerminal 3215 CheckRunVimInTerminal
3216 3216
3217 " FIXME: the second property causes a hang
3218 let lines =<< trim END 3217 let lines =<< trim END
3219 vim9script 3218 vim9script
3220 setline(1, ['first line', 'second line '->repeat(50), 'third', 'fourth']) 3219 setline(1, ['first line', range(80)->join(' '), 'third', 'fourth'])
3221 set nowrap 3220 set nowrap
3222 prop_type_add('theprop', {highlight: 'DiffChange'}) 3221 prop_type_add('theprop', {highlight: 'DiffChange'})
3223 prop_add(1, 0, { 3222 prop_add(1, 0, {
3224 type: 'theprop', 3223 type: 'theprop',
3225 text: 'after the text '->repeat(5), 3224 text: 'right after the text '->repeat(3),
3226 text_align: 'after', 3225 text_align: 'after',
3227 text_padding_left: 2, 3226 text_padding_left: 2,
3228 }) 3227 })
3229 #prop_add(1, 0, { 3228 prop_add(1, 0, {
3230 # type: 'theprop', 3229 type: 'theprop',
3231 # text: 'after the text '->repeat(5), 3230 text: 'in the middle '->repeat(4),
3232 # text_align: 'after', 3231 text_align: 'after',
3233 # text_padding_left: 2, 3232 text_padding_left: 3,
3234 #}) 3233 })
3234 prop_add(1, 0, {
3235 type: 'theprop',
3236 text: 'the last one '->repeat(3),
3237 text_align: 'after',
3238 text_padding_left: 1,
3239 })
3235 normal 2Gw 3240 normal 2Gw
3236 END 3241 END
3237 call writefile(lines, 'XTextAfterNowrap', 'D') 3242 call writefile(lines, 'XTextAfterNowrap', 'D')
3238 let buf = RunVimInTerminal('-S XTextAfterNowrap', #{rows: 8, cols: 60}) 3243 let buf = RunVimInTerminal('-S XTextAfterNowrap', #{rows: 8, cols: 60})
3239 call VerifyScreenDump(buf, 'Test_text_after_nowrap_1', {}) 3244 call VerifyScreenDump(buf, 'Test_text_after_nowrap_1', {})
3245
3246 call term_sendkeys(buf, "30w")
3247 call VerifyScreenDump(buf, 'Test_text_after_nowrap_2', {})
3248
3249 call term_sendkeys(buf, "22w")
3250 call VerifyScreenDump(buf, 'Test_text_after_nowrap_3', {})
3251
3252 call term_sendkeys(buf, "$")
3253 call VerifyScreenDump(buf, 'Test_text_after_nowrap_4', {})
3240 3254
3241 call StopVimInTerminal(buf) 3255 call StopVimInTerminal(buf)
3242 endfunc 3256 endfunc
3243 3257
3244 func Test_text_below_nowrap() 3258 func Test_text_below_nowrap()