mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 10:22:43 +00:00
feat(input): disable completion engines in input
This commit is contained in:
parent
05f736d4eb
commit
37038df00d
2 changed files with 16 additions and 1 deletions
|
@ -41,6 +41,8 @@ M.meta = {
|
|||
---@field backdrop? number|false|snacks.win.Backdrop Opacity of the backdrop (default: 60)
|
||||
---@field wo? vim.wo|{} window options
|
||||
---@field bo? vim.bo|{} buffer options
|
||||
---@field b? table<string, any> buffer local variables
|
||||
---@field w? table<string, any> window local variables
|
||||
---@field ft? string filetype to use for treesitter/syntax highlighting. Won't override existing filetype
|
||||
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys> Key mappings
|
||||
---@field on_buf? fun(self: snacks.win) Callback after opening the buffer
|
||||
|
@ -420,6 +422,11 @@ function M:show()
|
|||
|
||||
self:open_buf()
|
||||
|
||||
-- buffer local variables
|
||||
for k, v in pairs(self.opts.b or {}) do
|
||||
vim.b[self.buf][k] = v
|
||||
end
|
||||
|
||||
-- OPTIM: prevent treesitter or syntax highlighting to attach on FileType if it's not already enabled
|
||||
local optim_hl = not vim.b[self.buf].ts_highlight and vim.bo[self.buf].syntax == ""
|
||||
vim.b[self.buf].ts_highlight = optim_hl or vim.b[self.buf].ts_highlight
|
||||
|
@ -431,10 +438,14 @@ function M:show()
|
|||
end
|
||||
|
||||
self:open_win()
|
||||
-- window local variables
|
||||
for k, v in pairs(self.opts.w or {}) do
|
||||
vim.w[self.win][k] = v
|
||||
end
|
||||
Snacks.util.wo(self.win, self.opts.wo)
|
||||
if Snacks.util.is_transparent() then
|
||||
self.opts.wo.winblend = 0
|
||||
end
|
||||
Snacks.util.wo(self.win, self.opts.wo)
|
||||
if self.opts.on_win then
|
||||
self.opts.on_win(self)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue