SublimeKSP icon indicating copy to clipboard operation
SublimeKSP copied to clipboard

{} compile as comments even when used in text strings

Open mkruselj opened this issue 8 years ago • 3 comments

This is not supposed to happen! Example:

set_text(Label,"First section: { " & var & " } | The rest")

Actually compiles as:

set_text(Label,"First section: | The rest")

Not cool!

mkruselj avatar Nov 29 '16 15:11 mkruselj

Also, I'm having an issue with block comments not toggling on/off correctly... It just keeps adding block comments. Sometimes a restart of Sublime Text helps, but not always...

This was not a problem in vanilla SublimeKSP...

mkruselj avatar Nov 30 '16 14:11 mkruselj

Very strange... I'll take a look at this when I get a moment.

SamWindell avatar Dec 01 '16 11:12 SamWindell

Here's the regex for the {} comments: https://github.com/nojanath/SublimeKSP/blob/9132114ff504f04646208130ed6fa5355f61c7b6/ksp_compiler3/ksp_compiler.py#L37

Unless I'm mistaken, it's only the character directly before the { that is checked if it is a quote. I think we'd need a more complicated regex to do proper checking for comments.

Not sure about the block comments toggle! The only thing that is added by KSP to enable this is the TM_COMMENT_START_2 and TM_COMMENT_END_2 in the tmpreferences file.

SamWindell avatar Dec 07 '16 16:12 SamWindell