From 3d84cf6ff4361e318a0571c87d44e8a77c1c2839 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 13 Oct 2018 10:53:05 +0200 Subject: api: make nvim_buf_set_virtual_text handle invalid chars Clients are supposed to supply only valid text, but if it is invalid, translate it rather than messing up the screen --- test/functional/ui/bufhl_spec.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua index ba3e44b677..29173ed7ee 100644 --- a/test/functional/ui/bufhl_spec.lua +++ b/test/functional/ui/bufhl_spec.lua @@ -413,5 +413,16 @@ describe('Buffer highlighting', function() | ]]) + set_virtual_text(0, 0, {{"x\tx\ny\ry", "Statement"}, {"aa\000bb", "Number"}}, {}) + screen:expect([[ + 1 + 2 {3:x^Ix^@y^My}{2:aa} | + ^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5| + , 5, 5, 5, 5, 5, 5,{1:-} | + x = 4 | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]) end) end) -- cgit