fix: check if is sidebar buf (#179)

This commit is contained in:
yetone
2024-08-24 00:14:20 +08:00
committed by GitHub
parent 43c5544a29
commit 7bea73eb80
4 changed files with 28 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
local api = vim.api
local Utils = require("avante.utils")
local Sidebar = require("avante.sidebar")
local Selection = require("avante.selection")
local Config = require("avante.config")
@@ -168,10 +169,9 @@ M.refresh = function()
return
end
local ft = vim.api.nvim_get_option_value("filetype", { buf = curbuf })
local listed = vim.api.nvim_get_option_value("buflisted", { buf = curbuf })
if ft == "Avante" or not listed then
if Utils.is_sidebar_buffer(curbuf) or not listed then
return
end