fix(win): error when enabling padding with listchars="" (#786)
Some checks failed
CI / ci (push) Failing after 0s

## Description

`vim.split` would split `""` into `{ "" }`, causing `table.concat` to
output `",eol: "`.

Resolved by using `vim.tbl_filter` to filter out empty strings before
applying `table.concat`.
This commit is contained in:
PFiS 2025-01-30 04:07:36 +08:00 committed by GitHub
parent 5e475dc11e
commit 6effbcdff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -895,7 +895,7 @@ end
function M:add_padding()
local listchars = vim.split(self.opts.wo.listchars or "", ",")
listchars = vim.tbl_filter(function(s)
return not s:find("eol:")
return not s:find("eol:") and s ~= ""
end, listchars)
table.insert(listchars, "eol: ")
self.opts.wo.listchars = table.concat(listchars, ",")