mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +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:
@@ -658,7 +658,10 @@ function M.set(namespace, bufnr, diagnostics, opts)
|
||||
|
||||
vim.api.nvim_buf_call(bufnr, function()
|
||||
vim.api.nvim_command(
|
||||
string.format("doautocmd <nomodeline> DiagnosticChanged %s", vim.api.nvim_buf_get_name(bufnr))
|
||||
string.format(
|
||||
"doautocmd <nomodeline> DiagnosticChanged %s",
|
||||
vim.fn.fnameescape(vim.api.nvim_buf_get_name(bufnr))
|
||||
)
|
||||
)
|
||||
end)
|
||||
end
|
||||
@@ -1333,7 +1336,7 @@ function M.reset(namespace, bufnr)
|
||||
end
|
||||
|
||||
vim.api.nvim_command(
|
||||
string.format("doautocmd <nomodeline> DiagnosticChanged %s", vim.api.nvim_buf_get_name(bufnr))
|
||||
string.format("doautocmd <nomodeline> DiagnosticChanged %s", vim.fn.fnameescape(vim.api.nvim_buf_get_name(bufnr)))
|
||||
)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user