feat(ui): add config to turn off hints popup (#75)
This commit is contained in:
		
							parent
							
								
									2700cad921
								
							
						
					
					
						commit
						29dabc4768
					
				@ -138,6 +138,10 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_
 | 
				
			|||||||
    ---@type string | fun(): any
 | 
					    ---@type string | fun(): any
 | 
				
			||||||
    list_opener = "copen",
 | 
					    list_opener = "copen",
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  --- @class AvanteHintsConfig
 | 
				
			||||||
 | 
					  hints = {
 | 
				
			||||||
 | 
					    enbaled = true,
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -82,6 +82,10 @@ M.defaults = {
 | 
				
			|||||||
    ---@type string | fun(): any
 | 
					    ---@type string | fun(): any
 | 
				
			||||||
    list_opener = "copen",
 | 
					    list_opener = "copen",
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  --- @class AvanteHintsConfig
 | 
				
			||||||
 | 
					  hints = {
 | 
				
			||||||
 | 
					    enbaled = true,
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---@type avante.Config
 | 
					---@type avante.Config
 | 
				
			||||||
@ -92,6 +96,10 @@ M.options = {}
 | 
				
			|||||||
---@field highlights AvanteConflictHighlights
 | 
					---@field highlights AvanteConflictHighlights
 | 
				
			||||||
M.diff = {}
 | 
					M.diff = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---@class AvanteHintsConfig
 | 
				
			||||||
 | 
					---@field enabled boolean
 | 
				
			||||||
 | 
					M.hints = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
---@param opts? avante.Config
 | 
					---@param opts? avante.Config
 | 
				
			||||||
function M.setup(opts)
 | 
					function M.setup(opts)
 | 
				
			||||||
  M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
 | 
					  M.options = vim.tbl_deep_extend("force", M.defaults, opts or {})
 | 
				
			||||||
 | 
				
			|||||||
@ -62,6 +62,9 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function Selection:setup_autocmds()
 | 
					function Selection:setup_autocmds()
 | 
				
			||||||
  Selection.did_setup = true
 | 
					  Selection.did_setup = true
 | 
				
			||||||
 | 
					  if Config.hints.enabled == false then
 | 
				
			||||||
 | 
					    return self
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
  api.nvim_create_autocmd({ "ModeChanged" }, {
 | 
					  api.nvim_create_autocmd({ "ModeChanged" }, {
 | 
				
			||||||
    group = self.augroup,
 | 
					    group = self.augroup,
 | 
				
			||||||
    pattern = { "n:v", "n:V", "n:" }, -- Entering Visual mode from Normal mode
 | 
					    pattern = { "n:v", "n:V", "n:" }, -- Entering Visual mode from Normal mode
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user