diff options
| author | Kalka <kalka2088@gmail.com> | 2023-01-30 16:06:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-30 22:06:47 +0100 |
| commit | 65287605c39a41a8e3ec905a318b0a727f84910d (patch) | |
| tree | fdec8d8527c353010f950354a0313e6d7011402c /lua/telescope | |
| parent | 19ce7f8f24d6cb0d2930ce1eb3096ff14c94fa68 (diff) | |
fix: wrap nvim_buf_set_option in a protected call (#2346)
Diffstat (limited to 'lua/telescope')
| -rw-r--r-- | lua/telescope/previewers/utils.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lua/telescope/previewers/utils.lua b/lua/telescope/previewers/utils.lua index bd8c300..2369305 100644 --- a/lua/telescope/previewers/utils.lua +++ b/lua/telescope/previewers/utils.lua @@ -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 |
