When highlight link is nested, caw.vim fails to uncomment.
Cause
In the current implementation, s:comment_detectable.has_syntax uses synIDtrans to get the terminal syntax name.
If the terminal syntax name does not contain Comment, s:comment_detectable.has_syntax will return 0.
hi! link vimLineComment Comment
hi! link Comment hogeColor
hi! hogeColor ctermfg=8
let id = hlID('vimLineComment')
echo synIDattr(synIDtrans(id), 'name') " 'hogeColor'
For example, it will succeed if the highlight settings are as follows.
hi! link vimLineComment Comment
hi! Comment ctermfg=8
let id = hlID('vimLineComment')
echo synIDattr(synIDtrans(id), 'name') " 'Comment'
Solution
Use both synIDattr(id, 'name') and synIDattr(synIDtrans(id), 'name').
Problem
When highlight link is nested, caw.vim fails to uncomment.
Cause
In the current implementation,
s:comment_detectable.has_syntax
uses synIDtrans to get the terminal syntax name. If the terminal syntax name does not containComment
,s:comment_detectable.has_syntax
will return 0.https://github.com/tyru/caw.vim/blob/3aefcb5a752a599a9200dd801d6bcb0b7606bf29/autoload/caw/actions/traits/comment_detectable.vim#L70
For exacmple.
For example, it will succeed if the highlight settings are as follows.
Solution
Use both
synIDattr(id, 'name')
andsynIDattr(synIDtrans(id), 'name')
.