mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(float): only set default filetype if no ft is set
This commit is contained in:
parent
a528e77397
commit
66b252535c
2 changed files with 4 additions and 6 deletions
|
|
@ -33,9 +33,7 @@ local defaults = {
|
|||
zindex = 50,
|
||||
},
|
||||
wo = {},
|
||||
bo = {
|
||||
filetype = "snacks_float",
|
||||
},
|
||||
bo = {},
|
||||
keys = {
|
||||
q = "close",
|
||||
},
|
||||
|
|
@ -115,8 +113,8 @@ function M:show()
|
|||
else
|
||||
self.buf = vim.api.nvim_create_buf(false, true)
|
||||
end
|
||||
if self.opts.bo and vim.bo[self.buf].filetype ~= "" then
|
||||
self.opts.bo.filetype = nil
|
||||
if vim.bo[self.buf].filetype == "" and not self.opts.bo.filetype then
|
||||
self.opts.bo.filetype = "snacks_float"
|
||||
end
|
||||
self:set_options("buf")
|
||||
for k, v in pairs(self.opts.b or {}) do
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ function M.open(cmd, opts)
|
|||
vim.cmd.startinsert()
|
||||
end,
|
||||
})
|
||||
vim.cmd("noh")
|
||||
end
|
||||
vim.cmd("noh")
|
||||
return float
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue