Sublime Forum

Block commenting not working inside other scopes in custom syntax

#1

I have a custom syntax that I created to do various scope highlighting for text/log files. If any selected text or the carat is within text of the base scope, both the ctrl+shift+/ and Toggle Block Comment via the command palette work to enter the snippet to toggle the block comment for the text/around the carat.

However, if any of the selected text is inside another of the scopes in my syntax, whether I use the shortcut or command palette, the block comment simply does the same thing as the regular comment instead of doing a block comment.

0 Likes

#2

I figured this out. Because of the way I have my sublime-syntax file set up, the main scope is no longer shown when inside another scope. But each of my sub scopes begin with “region”. After including region in the list of scopes in my Comments.tmPreferences file, the block commenting works properly again.

0 Likes