From 65287605c39a41a8e3ec905a318b0a727f84910d Mon Sep 17 00:00:00 2001 From: Kalka Date: Mon, 30 Jan 2023 16:06:47 -0500 Subject: [PATCH] fix: wrap nvim_buf_set_option in a protected call (#2346) --- lua/telescope/previewers/utils.lua | 3 +-- 1 file changed, 1 insertion(+), 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