Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{} compile as comments even when used in text strings #46

Open
mkruselj opened this issue Nov 29, 2016 · 3 comments
Open

{} compile as comments even when used in text strings #46

mkruselj opened this issue Nov 29, 2016 · 3 comments
Labels

Comments

@mkruselj
Copy link
Collaborator

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
Copy link
Collaborator Author

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...

@SamWindell
Copy link
Contributor

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

@SamWindell
Copy link
Contributor

Here's the regex for the {} comments:

comment_re = re.compile(r'(?<!["\'])\{.*?\}|\(\*.*?\*\)', re.DOTALL) # if { is preceeded by ' or " don't treat it as a comment

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.

@eitherys eitherys added the Bug label Sep 24, 2017
@eitherys eitherys reopened this Sep 25, 2017
@mkruselj mkruselj reopened this Jun 10, 2021
@mkruselj mkruselj changed the title {} compile as comments even when used as text strings {} compile as comments even when used in text strings Dec 6, 2022
Repository owner deleted a comment from eitherys Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants