-
Notifications
You must be signed in to change notification settings - Fork 591
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] rewrite syntaxes #370
Conversation
632c39b
to
e753c50
Compare
I added a list item to remove incompatible regex patterns |
This will also affect the |
8ea5672
to
cac8db8
Compare
Will fix them too. |
8eddab1
to
4a0c364
Compare
Just a few points:
{
"keys": ["\""], "command": "insert_snippet", "args": {"contents": "``$0''"}, "context": [
{ "key": "selector", "operator": "equal", "operand": "text.tex.latex - (meta.environment.verbatim.latex, meta.environment.math.latex)" }
]
}
|
|
One regression I've noticed is that this syntax doesn't properly handle commands in optional arguments where there is a specific rule for the main command. For example, in a command like: \makebox[\linewidth]{...}
|
The issue related optional arguments is new to this syntax as the original syntax doesn't detect optional arguments at all (at least for |
0ef2120
to
0b3d250
Compare
General ST question: is it possible (in the colorscheme or elsewhere) to present a scope in super- or subscript position? It would be nice to show something like |
No. I also wouldn't be too pleased by this tbh. |
Okay thanks. I personally think this and named foldings like |
@r-stein I would let other packages to handle it. Some users may not like this idea. |
@randy3k As far ich know this is not possible in ST, it was just a general comment :) |
@Eyenseo Yes, syntaxes are global to Sublime Text, and are not per-project. |
@@ -552,7 +552,7 @@ contexts: | |||
4: variable.parameter.function.latex | |||
5: punctuation.definition.group.brace.end.latex | |||
push: | |||
- meta_scope: meta.environment.math.block.be.latex | |||
- meta_content_scope: meta.environment.math.block.be.latex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, shall this also be applied to \[\]
and \(\)
and $$
and $
pairs?
Though, it may break BracketHighlighter or make BracketHighlighter hard to highlight brackets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not apply this to those pairs, because it would break bracket highlighter and I don't see disadvantages for it.
Since it should have the same or a special highlighting and it has only 1-2 chars and is therefore to short to use hotkeys inside. However I agree, that it might look less consistent.
Nonetheless I think this is the best solution to do it like this.
I've been using this syntax for a while now and reported everything I noticed so far. This is obviously a great improvement over the current LaTeX syntax but people will need to adapt to changes since things are highlighted differently now (e.g. The only remaining thing is inline Python highlighting which is seemingly broken "just for me". Since I did work on the syntax that relates to the resulting highlighting, I should be able to know why it behaves that way, but I don't just from thinking about it and I lack the time to actually investigate into it. I have a couple more changes planned for the Python syntax and will take a look at this again once I find time for that. So far, this is getting a big 👍 from me. If users spot errors once they start using the changes in their setup, we can always fix those later. |
I agree this is a major improvement over the previous syntax. One small regression I've noticed is that commands in optional brackets after Not really a big a deal though. |
@ig0774 fixed. |
It might be worth to discuss to omit the scope |
Firstly, just want to clarify, it does not seem that I have the splitting issue. Secondly, I would rather keep the scope for potential different highlight via color scheme. Some users may be interested in highlighting backslashes with a different color. |
I see, I could reproduce it now. My suggestion is to not do soft wrap, do hard wrap instead. Hard wrap also improves the results in reverse synctex search from the pdf. |
@r-stein it is intended. The content inside the bracket can create all sort of issues. Consider \newcommand{\foo}{\begin{equation}}
\newcommand{\bla}{\[} If we start to match the content, it will be difficult to close the scope, so only commands and constants are highlighted inside the bracket. This is actually the whole reason I started this re-write. |
Ah okay I agree. |
Thank you for all of your work on this @randy3k. And thank you to everyone who has been reviewing it and giving feedback. |
Fixes sublimehq#608 The issue was partly fixed by PR sublimehq#370. This commit adds support for highlighting XML/HTML inside \begin{minted}{...} ... \end{minted}.
Fixes sublimehq#608 The issue was partly fixed by PR sublimehq#370. This commit adds support for highlighting XML/HTML inside \begin{minted}{...} ... \end{minted}.
close #340
The follow up PR for #340, things to be done
R/Rd (R Documentation)
andHaskell/Literate Haskell
There are many changes, I just list the important breaking changes
string.other.math.tex
->meta.environment.math
meta.environment.list.itemize.latex
meta.environment.list.enumerate.latex
meta.environment.list.description.latex
meta.environment.list.list.latex
External packages' support can be added to the
packages
pattern ofLaTeX
syntax.@csch0 @msiniscalchi @ig0774 Do you have any comments? This PR will certainly break your packages. We might have to discuss the naming convention of the scopes.