mirror of
https://github.com/neovim/neovim.git
synced 2025-11-21 09:36:29 +00:00
fix(editorconfig): check that buffer is valid
Fixes: https://github.com/neovim/neovim/issues/23921
(cherry picked from commit 1cf3184f95)
This commit is contained in:
committed by
github-actions[bot]
parent
af1f4c7122
commit
d7212c10e2
@@ -6,6 +6,7 @@ local pathsep = helpers.get_pathsep()
|
||||
local curbufmeths = helpers.curbufmeths
|
||||
local funcs = helpers.funcs
|
||||
local meths = helpers.meths
|
||||
local exec_lua = helpers.exec_lua
|
||||
|
||||
local testdir = 'Xtest-editorconfig'
|
||||
|
||||
@@ -207,4 +208,15 @@ But not this one
|
||||
test_case('3_space.txt', { shiftwidth = 42 })
|
||||
test_case('4_space.py', { shiftwidth = 4 })
|
||||
end)
|
||||
|
||||
it('does not operate on invalid buffers', function()
|
||||
local ok, err = unpack(exec_lua([[
|
||||
vim.cmd.edit('test.txt')
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
vim.cmd.bwipeout(bufnr)
|
||||
return {pcall(require('editorconfig').config, bufnr)}
|
||||
]]))
|
||||
|
||||
eq(true, ok, err)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user