Skip to content

Commit

Permalink
fix: avoid sign_hl_group nil index
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvbaal committed Dec 23, 2023
1 parent 7d593a2 commit 3b62975
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/statuscol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ local function update_sign_defined(win, ext, reassign)
local signs = ext or f.sign_getdefined()
for i = 1, #signs do
local s = ext and signs[i][4] or signs[i]
local name = ext and s.sign_text and s.sign_text..s.sign_hl_group or s.name
local name = s.name or s.sign_text
if s.sign_text or s.text then
if ext then
s.text = s.sign_text
if not idmap[s.ns_id] then update_nsidmap() end
s.ns = idmap[s.ns_id]
if s.sign_hl_group then name = name..s.sign_hl_group end
end
s.wtext = s.text:gsub("%s", "")
s.texthl = ext and s.sign_hl_group or s.texthl or "NoTexthl"
Expand Down Expand Up @@ -183,8 +184,9 @@ end
local function place_signs(win, signs, ext)
for i = 1, #signs do
local s = ext and signs[i][4] or signs[i]
local name = ext and s.sign_text and s.sign_text..s.sign_hl_group or s.name
if ext and not name then goto nextsign end
local name = s.name or s.sign_text
if not name then goto nextsign end
if ext and s.sign_hl_group then name = name..s.sign_hl_group end
if not sign_cache[name] then update_sign_defined(win, ext and signs) end
local sign = sign_cache[name]
if not sign or not sign.segment then goto nextsign end
Expand Down

0 comments on commit 3b62975

Please sign in to comment.