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

[LaTeX Syntax] newcolumntype in package array #685

Closed
Romern opened this issue Nov 4, 2016 · 5 comments
Closed

[LaTeX Syntax] newcolumntype in package array #685

Romern opened this issue Nov 4, 2016 · 5 comments

Comments

@Romern
Copy link

Romern commented Nov 4, 2016

If I use the command \newcolumntype{L}{>{$}l<{$}} the highlighting is a bit off:
newcolumntype1

@Elliot2560
Copy link
Contributor

I'm having the exact same issue. Went through a bunch of debugging and found out that the root of the issue was in the syntax definition. It seems that the second $ in each of the commands is not matched because there is a hanging {. The same behaviour occurs with sequences like $ { $ (granted, this is not a valid use case).

@r-stein
Copy link
Contributor

r-stein commented Jan 23, 2017

It may be an idea to automatically end the math mode if we match an unescaped and unmatched }. This is not the perfect solution, but would help in such cases and not break the whole remaining file.

@Elliot2560
Copy link
Contributor

I considered that, but I don't think you can really have unmatched delimiters unless in macros, so I don't think it's wise to exit math mode this way. LaTeX is a bit similar to C because without basically preforming preprocessing, it's impossible to perfect cover all changes on the default syntax highlighting due to macros. So I think it's more realistic to just cover the default newcommand and commands from popular packages, which in this case is >{}, <{}, etc., from tabular. Or maybe adding preprocessing utilities to LaTeXTools? :P

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 26, 2017

The blessing and the curse of a powerful macro system in programming languages.

I should check out how Rust's macro system works just so I can understand how it does things differently. It certainly helps that macros end with an exclamation mark.

deathaxe pushed a commit to deathaxe/sublime-packages that referenced this issue Aug 25, 2019
This PR proposes to close some already fixed issues, which were not (correctly) referenced in the fixing pull requests.

Closes sublimehq#442
Closes sublimehq#685
Closes sublimehq#691 (invalid)
Closes sublimehq#795
Closes sublimehq#807
Closes sublimehq#903
Closes sublimehq#1141
Closes sublimehq#1172
Closes sublimehq#1245
Closes sublimehq#1257
Closes sublimehq#1286
Closes sublimehq#1320
Closes sublimehq#1357
Closes sublimehq#1382 (wontfix)
Closes sublimehq#1403
Closes sublimehq#1451
Closes sublimehq#1453 (maybe)
Closes sublimehq#1472
Closes sublimehq#1495
Closes sublimehq#1540
Closes sublimehq#1542
Closes sublimehq#1565
Closes sublimehq#1576
Closes sublimehq#1625
Closes sublimehq#1880
Closes sublimehq#1898
Closes sublimehq#1940 (invalid)
@wbond
Copy link
Member

wbond commented Oct 24, 2019

This issue has been solved by a previous commit, hence it is being closed.

@wbond wbond closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants