mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(diagnostic): escape special chars in file names (#16527)
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
@@ -1918,5 +1918,27 @@ describe('vim.diagnostic', function()
|
||||
return {show_called, hide_called}
|
||||
]])
|
||||
end)
|
||||
|
||||
it('triggers the autocommand when diagnostics are set', function()
|
||||
eq(1, exec_lua [[
|
||||
vim.g.diagnostic_autocmd_triggered = 0
|
||||
vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = 1')
|
||||
vim.api.nvim_buf_set_name(diagnostic_bufnr, "test | test")
|
||||
vim.diagnostic.set(diagnostic_ns, diagnostic_bufnr, {
|
||||
make_error('Diagnostic', 0, 0, 0, 0)
|
||||
})
|
||||
return vim.g.diagnostic_autocmd_triggered
|
||||
]])
|
||||
end)
|
||||
|
||||
it('triggers the autocommand when diagnostics are cleared', function()
|
||||
eq(1, exec_lua [[
|
||||
vim.g.diagnostic_autocmd_triggered = 0
|
||||
vim.cmd('autocmd DiagnosticChanged * let g:diagnostic_autocmd_triggered = 1')
|
||||
vim.api.nvim_buf_set_name(diagnostic_bufnr, "test | test")
|
||||
vim.diagnostic.reset(diagnostic_ns, diagnostic_bufnr)
|
||||
return vim.g.diagnostic_autocmd_triggered
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user