Fix invalid buffer id

This commit is contained in:
hedy
2023-11-02 20:15:29 +08:00
parent 23b31c64e8
commit b495ccc3ef
2 changed files with 3 additions and 4 deletions

View File

@@ -125,7 +125,7 @@ Key:
- ✅ Fix some options - ✅ Fix some options
(#180 by cljoly) (#180 by cljoly)
- fix: Invalid buffer id error - fix: Invalid buffer id error
(#177 by snowair) (#177 by snowair)
- ✅ fix(code_actions): use the builtin code_action - ✅ fix(code_actions): use the builtin code_action

View File

@@ -5,9 +5,8 @@ local ui = require 'symbols-outline.ui'
local M = {} local M = {}
local function is_buffer_outline(bufnr) local function is_buffer_outline(bufnr)
local isValid = vim.api.nvim_buf_is_valid(bufnr) if not vim.api.nvim_buf_is_valid(bufnr) then
if not isValid then return false
return
end end
local name = vim.api.nvim_buf_get_name(bufnr) local name = vim.api.nvim_buf_get_name(bufnr)
local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype') local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype')