@@ -418,7 +418,7 @@ func Test_bg_detection()
418418 hi Normal ctermbg= 15
419419 call assert_equal (' light' , &bg )
420420
421- " manually-set &bg takes precendence over auto-detection
421+ " manually-set &bg takes precedence over auto-detection
422422 set bg = light
423423 hi Normal ctermbg= 4
424424 call assert_equal (' light' , &bg )
@@ -461,7 +461,6 @@ func Test_syntax_hangs()
461461 bwipe!
462462endfunc
463463
464-
465464func Test_conceal ()
466465 if ! has (' conceal' )
467466 return
@@ -497,3 +496,27 @@ func Test_conceal()
497496 set conceallevel&
498497 bw !
499498endfunc
499+
500+ fun Test_synstack_synIDtrans ()
501+ new
502+ setfiletype c
503+ syntax on
504+ call setline (1 , ' /* A comment with a TODO */' )
505+
506+ call assert_equal ([], synstack (1 , 1 ))
507+
508+ norm f /
509+ call assert_equal ([' cComment' , ' cCommentStart' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(v:val, "name")' ))
510+ call assert_equal ([' Comment' , ' Comment' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(synIDtrans(v:val), "name")' ))
511+
512+ norm fA
513+ call assert_equal ([' cComment' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(v:val, "name")' ))
514+ call assert_equal ([' Comment' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(synIDtrans(v:val), "name")' ))
515+
516+ norm fT
517+ call assert_equal ([' cComment' , ' cTodo' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(v:val, "name")' ))
518+ call assert_equal ([' Comment' , ' Todo' ], map (synstack (line (" ." ), col (" ." )), ' synIDattr(synIDtrans(v:val), "name")' ))
519+
520+ syn clear
521+ bw !
522+ endfunc
0 commit comments