From e9e4c30b68abe456d80a0b144149ebf3f4527ed8 Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Fri, 16 Feb 2024 02:55:27 +0800 Subject: [PATCH] fix: avoid repeat foldclose or foldopen chars when `'wrap'` is set (#107) --- lua/statuscol/builtin.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/statuscol/builtin.lua b/lua/statuscol/builtin.lua index cd36eeb..9febdbf 100644 --- a/lua/statuscol/builtin.lua +++ b/lua/statuscol/builtin.lua @@ -46,7 +46,9 @@ function M.foldfunc(args) -- For each column, add a foldopen, foldclosed, foldsep or padding char local range = level < width and level or width for col = 1, range do - if closed and (col == level or col == width) then + if args.virtnum ~= 0 then + string = string..args.fold.sep + elseif closed and (col == level or col == width) then string = string..args.fold.close elseif foldinfo.start == args.lnum and first_level + col > foldinfo.llevel then string = string..args.fold.open