Fix support for embedded lua in vimscript (#513)

Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
This commit is contained in:
Yuxin Wu
2023-04-20 09:42:14 -07:00
committed by GitHub
parent 457b383767
commit 78029a0e90

View File

@@ -2524,8 +2524,9 @@ function! s:IsDelimValid(delimiter, delIndx, line) abort
"vim comments are so fucking stupid!! Why the hell do they have comment "vim comments are so fucking stupid!! Why the hell do they have comment
"delimiters that are used elsewhere in the syntax?!?! We need to check "delimiters that are used elsewhere in the syntax?!?! We need to check
"some conditions especially for vim "some conditions especially for vim.
if &filetype ==# 'vim' "Also check &commentstring because it may be overwritten for embedded lua.
if &filetype ==# 'vim' && &commentstring[0] ==# '"'
if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\")) if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\"))
return 0 return 0
endif endif