diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-27 22:49:44 +0100 |
commit | c1015121ec626cab6cb384f544bc0be1a1760c0e (patch) | |
tree | 6cc9a5d1899a4486a24c491e07d17a7dd01f9503 /runtime/lua/man.lua | |
parent | 4f030ec24e0e148bbb83aedaef7dd629e5fef130 (diff) | |
parent | e1876c7ad1b5e30c0a9919e2c4587d11550c8507 (diff) | |
download | rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.gz rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.bz2 rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.zip |
Merge 'upstream/master' into pr-win-erw7
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r-- | runtime/lua/man.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index b0fbe9cc35..1da8ed85fc 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -1,3 +1,5 @@ +require('vim.compat') + local buf_hls = {} local function highlight_line(line, linenr) @@ -10,9 +12,9 @@ local function highlight_line(line, linenr) local attr = NONE local byte = 0 -- byte offset - local function end_attr_hl(attr) + local function end_attr_hl(attr_) for i, hl in ipairs(hls) do - if hl.attr == attr and hl.final == -1 then + if hl.attr == attr_ and hl.final == -1 then hl.final = byte hls[i] = hl end @@ -106,7 +108,7 @@ local function highlight_line(line, linenr) -- 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 - local match = '' + local match while sgr and #sgr > 0 do -- Match against SGR parameters, which may be separated by ';' match, sgr = sgr:match("^(%d*);?(.*)") |