Skip to content

Commit ad7ac9f

Browse files
committed
fix(curl): check if b:current_syntax exists before trying to unlet it
1 parent 2a1e6d9 commit ad7ac9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/rest-nvim/curl/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ local function create_callback(method, url)
164164
if vim.fn.filereadable(syntax_file) == 1 then
165165
vim.cmd(string.gsub(
166166
[[
167-
unlet b:current_syntax
167+
if exists("b:current_syntax")
168+
unlet b:current_syntax
169+
endif
168170
syn include @%s syntax/%s.vim
169171
syn region %sBody matchgroup=Comment start=+\v^#\+RESPONSE$+ end=+\v^#\+END$+ contains=@%s
170172

0 commit comments

Comments
 (0)