mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(win): simpler way to add buffer padding
This commit is contained in:
parent
334895c5bb
commit
f59237f1dc
1 changed files with 1 additions and 12 deletions
|
|
@ -387,20 +387,9 @@ function M:show()
|
|||
end
|
||||
|
||||
function M:add_padding()
|
||||
if not self:buf_valid() then
|
||||
return
|
||||
end
|
||||
local ns = vim.api.nvim_create_namespace("snacks_win_padding")
|
||||
vim.api.nvim_buf_clear_namespace(self.buf, ns, 0, -1)
|
||||
self.opts.wo.statuscolumn = " "
|
||||
self.opts.wo.list = true
|
||||
self.opts.wo.showbreak = " "
|
||||
self.opts.wo.listchars = ("eol: ," .. (self.opts.wo.listchars or "")):gsub(",$", "")
|
||||
for l = 1, vim.api.nvim_buf_line_count(self.buf) do
|
||||
vim.api.nvim_buf_set_extmark(self.buf, ns, l - 1, 0, {
|
||||
virt_text = { { " " } },
|
||||
virt_text_pos = "inline",
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function M:is_floating()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue