feat(ui): add config to turn off hints popup (#75)

This commit is contained in:
Yuexun 2024-08-19 12:40:33 +10:00 committed by GitHub
parent 2700cad921
commit 29dabc4768
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -138,6 +138,10 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_
---@type string | fun(): any
list_opener = "copen",
},
--- @class AvanteHintsConfig
hints = {
enbaled = true,
}
}
```

View File

@ -82,6 +82,10 @@ M.defaults = {
---@type string | fun(): any
list_opener = "copen",
},
--- @class AvanteHintsConfig
hints = {
enbaled = true,
},
}
---@type avante.Config
@ -92,6 +96,10 @@ M.options = {}
---@field highlights AvanteConflictHighlights
M.diff = {}
---@class AvanteHintsConfig
---@field enabled boolean
M.hints = {}
---@param opts? avante.Config
function M.setup(opts)
M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})

View File

@ -62,6 +62,9 @@ end
function Selection:setup_autocmds()
Selection.did_setup = true
if Config.hints.enabled == false then
return self
end
api.nvim_create_autocmd({ "ModeChanged" }, {
group = self.augroup,
pattern = { "n:v", "n:V", "n:" }, -- Entering Visual mode from Normal mode