fix: wrap nvim_buf_set_option in a protected call (#2346)

This commit is contained in:
Kalka
2023-01-30 16:06:47 -05:00
committed by GitHub
parent 19ce7f8f24
commit 65287605c3

View File

@@ -126,8 +126,7 @@ end
--- Attach regex highlighter
utils.regex_highlighter = function(bufnr, ft)
if has_filetype(ft) then
vim.api.nvim_buf_set_option(bufnr, "syntax", ft)
return true
return pcall(vim.api.nvim_buf_set_option, bufnr, "syntax", ft)
end
return false
end