From fdd8dcae01beb66397226ad65e4f1bbd3d1dd55c Mon Sep 17 00:00:00 2001 From: Kovas Palunas Date: Tue, 18 Jun 2019 13:35:35 -0700 Subject: man.vim: Handle ANSI escape sequences with ":" #10267 closes #10267 --- runtime/lua/man.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/man.lua') diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 1da8ed85fc..ba6b9d09c9 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -107,7 +107,9 @@ local function highlight_line(line, linenr) -- followed by '[', then a series of parameter and intermediate bytes in -- the range 0x20 - 0x3f, then 'm'. (See ECMA-48, sections 5.4 & 8.3.117) local sgr = prev_char:match("^%[([\032-\063]*)m$") - if sgr then + -- Ignore escape sequences with : characters, as specified by ITU's T.416 + -- Open Document Architecture and interchange format. + if sgr and not string.find(sgr, ":") then local match while sgr and #sgr > 0 do -- Match against SGR parameters, which may be separated by ';' -- cgit