fix: wrap nvim_buf_set_option in a protected call (#2346)
This commit is contained in:
@@ -126,8 +126,7 @@ end
|
|||||||
--- Attach regex highlighter
|
--- Attach regex highlighter
|
||||||
utils.regex_highlighter = function(bufnr, ft)
|
utils.regex_highlighter = function(bufnr, ft)
|
||||||
if has_filetype(ft) then
|
if has_filetype(ft) then
|
||||||
vim.api.nvim_buf_set_option(bufnr, "syntax", ft)
|
return pcall(vim.api.nvim_buf_set_option, bufnr, "syntax", ft)
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user