Skip to content

Commit

Permalink
fix: wrap nvim_buf_set_option in a protected call (#2346)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6528760)
  • Loading branch information
kalkafox authored and Conni2461 committed Feb 19, 2023
1 parent 4340c22 commit 686aea9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/telescope/previewers/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 686aea9

Please sign in to comment.