From 78029a0e903a6aae102b8bc44ee98d99ce609ff8 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Thu, 20 Apr 2023 09:42:14 -0700 Subject: [PATCH] Fix support for embedded lua in vimscript (#513) Co-authored-by: Yuxin Wu --- autoload/nerdcommenter.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/nerdcommenter.vim b/autoload/nerdcommenter.vim index e7dba6e..1a1beff 100644 --- a/autoload/nerdcommenter.vim +++ b/autoload/nerdcommenter.vim @@ -2524,8 +2524,9 @@ function! s:IsDelimValid(delimiter, delIndx, line) abort "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 - "some conditions especially for vim - if &filetype ==# 'vim' + "some conditions especially for vim. + "Also check &commentstring because it may be overwritten for embedded lua. + if &filetype ==# 'vim' && &commentstring[0] ==# '"' if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\")) return 0 endif