Create a new tab, use Set Syntax: C
, then open the console and enter view.meta_info("shellVariables", 0)
. The result is the C shellVariables
, which gives you the comment characters for that language:
[
{'name': 'TM_COMMENT_END_2', 'value': '*/'},
{'name': 'TM_COMMENT_START', 'value': '// '},
{'name': 'TM_COMMENT_START_2', 'value': '/*'}
]
Now use Set Syntax: Python
and re-run the command in the console, and it returns the Python shellVariables
instead:
[
{'name': 'TM_COMMENT_START', 'value': '# '},
{'name': 'TM_LINE_TERMINATOR', 'value': ':'}
]
For bonus points, use Set Syntax: HTML
and paste this:
<script type="text/javascript"> var x=12; </script>
When you run it with a position of 0, you get the HTML variables, because that’s the syntax at that position:
[
{'name': 'TM_COMMENT_END', 'value': ' -->'},
{'name': 'TM_COMMENT_START', 'value': '<!-- '}
]
Position 32 is inside the JavaScript portion of the buffer, so provifing that position gives you JavaScript information instead:
[
{'name': 'TM_COMMENT_END_2', 'value': '*/'},
{'name': 'TM_COMMENT_START', 'value': '// '},
{'name': 'TM_COMMENT_START_2', 'value': '/*'}
]