diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-03-22 21:00:38 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-03-22 21:03:58 +1100 |
| commit | a1e6799aa9a4b2509a6a3af7c4bf4889bb826e2e (patch) | |
| tree | 36b87936cd70af064d4f2a933391de1a3034911c /test | |
| parent | 7e75c9a1dfb1e7829fe72599e69ab64356c102c4 (diff) | |
Fix DisplayLines not tracking their buffer range correctly
After extracting the whole buffer content, a line can end up with
only non-range highlgihters pending which makes its range become
0.0,0.0, after running highlighting on the extracted range it gets
re-inserted but taking the min of existing range and inserted range
wrongly returns 0.0. Avoid this by detecting that the 0.0,0.0 range
does not actually mean anything when we have no ranged atoms.
Fixes #5001
Diffstat (limited to 'test')
4 files changed, 9 insertions, 0 deletions
diff --git a/test/regression/5001-line-highlighting-breaks-at-region/cmd b/test/regression/5001-line-highlighting-breaks-at-region/cmd new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/regression/5001-line-highlighting-breaks-at-region/cmd diff --git a/test/regression/5001-line-highlighting-breaks-at-region/in b/test/regression/5001-line-highlighting-breaks-at-region/in new file mode 100644 index 00000000..a38e2707 --- /dev/null +++ b/test/regression/5001-line-highlighting-breaks-at-region/in @@ -0,0 +1,2 @@ +#foo +bar diff --git a/test/regression/5001-line-highlighting-breaks-at-region/rc b/test/regression/5001-line-highlighting-breaks-at-region/rc new file mode 100644 index 00000000..78060e1c --- /dev/null +++ b/test/regression/5001-line-highlighting-breaks-at-region/rc @@ -0,0 +1,5 @@ +add-highlighter window/test regions +add-highlighter window/test/macro region %{#} %{(?=\\n)} group +add-highlighter window/test/code default-region group +add-highlighter window/ number-lines +add-highlighter window/ line 2 ,red diff --git a/test/regression/5001-line-highlighting-breaks-at-region/script b/test/regression/5001-line-highlighting-breaks-at-region/script new file mode 100644 index 00000000..f696b0d1 --- /dev/null +++ b/test/regression/5001-line-highlighting-breaks-at-region/script @@ -0,0 +1,2 @@ +ui_out -ignore 1 +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " 1│" }, { "face": { "fg": "black", "bg": "white", "underline": "default", "attributes": [] }, "contents": "#" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "foo\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " 2│" }, { "face": { "fg": "default", "bg": "red", "underline": "default", "attributes": [] }, "contents": "bar\u000a" }, { "face": { "fg": "default", "bg": "red", "underline": "default", "attributes": [] }, "contents": " " }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }' |
