We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a89f5f1 commit bc644cdCopy full SHA for bc644cd
lua/CopilotChat/utils.lua
@@ -210,10 +210,15 @@ function M.kv_list(tbl)
210
end
211
212
--- Check if a buffer is valid
213
+--- Check if the buffer is not a terminal
214
---@param bufnr number? The buffer number
215
---@return boolean
216
function M.buf_valid(bufnr)
- return bufnr and vim.api.nvim_buf_is_valid(bufnr) and vim.api.nvim_buf_is_loaded(bufnr) or false
217
+ return bufnr
218
+ and vim.api.nvim_buf_is_valid(bufnr)
219
+ and vim.api.nvim_buf_is_loaded(bufnr)
220
+ and vim.bo[bufnr].buftype ~= 'terminal'
221
+ or false
222
223
224
--- Check if file paths are the same
0 commit comments