feat(context): add current buffer to selected file ctx (#941)
This commit is contained in:
@@ -826,6 +826,21 @@ end
|
||||
function Sidebar:on_mount(opts)
|
||||
self:refresh_winids()
|
||||
|
||||
-- Add keymap to add current buffer while sidebar is open
|
||||
if Config.mappings.files and Config.mappings.files.add_current then
|
||||
vim.keymap.set("n", Config.mappings.files.add_current, function()
|
||||
if self:is_open() and self.file_selector:add_current_buffer() then
|
||||
vim.notify("Added current buffer to file selector", vim.log.levels.DEBUG, { title = "Avante" })
|
||||
else
|
||||
vim.notify("Failed to add current buffer", vim.log.levels.WARN, { title = "Avante" })
|
||||
end
|
||||
end, {
|
||||
desc = "avante: add current buffer to file selector",
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
end
|
||||
|
||||
api.nvim_set_option_value("wrap", Config.windows.wrap, { win = self.result_container.winid })
|
||||
|
||||
local current_apply_extmark_id = nil
|
||||
|
||||
Reference in New Issue
Block a user