Enable swapping commentstrings between HTML and GLSL shaders

This commit is contained in:
Knyffen 2023-10-27 10:10:39 +02:00
parent ddaae365d7
commit a58031863e

View File

@ -813,6 +813,13 @@ augroup CustomCommentDefinitions
setlocal commentstring=\/\/\ %s
endif
endif
if &ft == 'html'
if join(syntaxGroups, ',') =~ 'ShaderScript'
setlocal commentstring=\/\/\ %s
elseif join(syntaxGroups, ',') =~ 'html'
setlocal commentstring=<!--\ %s\ -->
endif
endif
endfunction
autocmd!
@ -826,7 +833,7 @@ augroup CustomCommentDefinitions
autocmd FileType dot setlocal commentstring=\/\/\ %s
autocmd FileType markdown setlocal commentstring=<!---\ %s\ -->
autocmd FileType html.epl setlocal commentstring=%#\ %s
autocmd FileType vue execute 'autocmd CustomCommentDefinitions CursorMoved <buffer> :call SetCommentString()'
autocmd FileType vue,html execute 'autocmd CustomCommentDefinitions CursorMoved <buffer> :call SetCommentString()'
" autocmd CursorMoved * :call SetCommentString()
augroup END