Skip to content

Commit

Permalink
feat: default string for empty auto sign segment
Browse files Browse the repository at this point in the history
Resolve #145
  • Loading branch information
luukvbaal committed Oct 16, 2024
1 parent ecc0417 commit 6c822aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ Each segment can contain the following elements:
-- below values list the default when omitted:
maxwidth = 1, -- maximum number of signs that will be displayed in this segment
colwidth = 2, -- number of display cells per sign in this segment
auto = false, -- when true, the segment will not be drawn if no signs matching
-- the pattern are currently placed in the buffer.
auto = false, -- boolean or string indicating what will be drawn when no signs
-- matching the pattern are currently placed in the buffer.
wrap = false, -- when true, signs in this segment will also be drawn on the
-- virtual or wrapped part of a line (when v:virtnum != 0).
fillchar = " ", -- character used to fill a segment with less signs than maxwidth
Expand Down
1 change: 1 addition & 0 deletions lua/statuscol/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function M.signfunc(args, segment)
if args.virtnum ~= 0 and not ss.wrap then return wss.empty.."%*" end
local sss = wss.signs[args.lnum]
local nonhl = ss.fillcharhl or (args.cul and args.relnum == 0 and "%#CursorLineSign#") or "%#SignColumn#"
if type(ss.auto) == "string" and wss.padwidth == 0 then return nonhl..ss.auto.."%*" end
if not sss then return nonhl..wss.empty.."%*" end
local text = ""
local signcount = #sss
Expand Down

0 comments on commit 6c822aa

Please sign in to comment.