Mercurial > vim
comparison src/testdir/test_textprop.vim @ 33868:25e5297fbc72 v9.0.2144
patch 9.0.2144: Text properties causes wrong line wrapping
Commit: https://github.com/vim/vim/commit/4e26a9aab6ad0ceb6bab0fd70e1031abb429f233
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Dec 3 17:50:47 2023 +0100
patch 9.0.2144: Text properties causes wrong line wrapping
Problem: Text properties causes wrong line wrapping to be drawn.
Solution: Find the index of the last text property that inserts text.
closes: #13611
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:08 +0100 |
parents | 0bb496f81ab2 |
children | 2c5ae1ce5af2 |
comparison
equal
deleted
inserted
replaced
33867:c80400d7f7fe | 33868:25e5297fbc72 |
---|---|
1417 call prop_add(1, 17, #{type: 'arg', length: len('argument')}) | 1417 call prop_add(1, 17, #{type: 'arg', length: len('argument')}) |
1418 END | 1418 END |
1419 call writefile(lines, 'XtestPropPrio', 'D') | 1419 call writefile(lines, 'XtestPropPrio', 'D') |
1420 let buf = RunVimInTerminal('-S XtestPropPrio', {'rows': 5}) | 1420 let buf = RunVimInTerminal('-S XtestPropPrio', {'rows': 5}) |
1421 call VerifyScreenDump(buf, 'Test_prop_at_same_pos', {}) | 1421 call VerifyScreenDump(buf, 'Test_prop_at_same_pos', {}) |
1422 | |
1423 " clean up | |
1424 call StopVimInTerminal(buf) | |
1425 endfunc | |
1426 | |
1427 func Test_textprop_in_empty_popup() | |
1428 CheckScreendump | |
1429 | |
1430 let lines =<< trim END | |
1431 vim9script | |
1432 | |
1433 hi def link FilterMenuMatch Constant | |
1434 prop_type_add('FilterMenuMatch', { | |
1435 highlight: "FilterMenuMatch", | |
1436 override: true, | |
1437 priority: 1000, | |
1438 combine: true, | |
1439 }) | |
1440 | |
1441 var winid = popup_create([{text: "hello", props: [ | |
1442 {col: 1, length: 1, type: 'FilterMenuMatch'}, | |
1443 {col: 2, length: 1, type: 'FilterMenuMatch'}, | |
1444 ]}], { | |
1445 minwidth: 20, | |
1446 minheight: 10, | |
1447 cursorline: false, | |
1448 highlight: "None", | |
1449 border: [], | |
1450 }) | |
1451 | |
1452 win_execute(winid, "setl nu cursorline cursorlineopt=both") | |
1453 popup_settext(winid, []) | |
1454 redraw | |
1455 END | |
1456 call writefile(lines, 'XtestPropEmptyPopup', 'D') | |
1457 let buf = RunVimInTerminal('-S XtestPropEmptyPopup', #{rows: 20, cols: 40}) | |
1458 call VerifyScreenDump(buf, 'Test_prop_in_empty_popup', {}) | |
1422 | 1459 |
1423 " clean up | 1460 " clean up |
1424 call StopVimInTerminal(buf) | 1461 call StopVimInTerminal(buf) |
1425 endfunc | 1462 endfunc |
1426 | 1463 |