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

(cherry picked from commit 65287605c3)
This commit is contained in:
Kalka
2023-01-30 16:06:47 -05:00
committed by Simon Hauser
parent 4340c22b63
commit 686aea90ef
+1 -2
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