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
Including package luacode causes some legit brackets to mismatch #1958
Comments
Can you explain this code? \directlua{prevcount=prevcount+\luastring{\pgfmathresult}} Is the entire string |
@lervag Yes the entire string AFAIK, anything inside and... |
Thanks for the explanation! As you probably understand, I am not so acquinted with lua. So, this leaves us with a quite hard problem: I'll look into it! As a first, I will consider the |
You are welcome! Btw, official LuaTeX documentation & implementation defines only For the difficulty of |
Ah, no, the point is that the By the way: Is If I understood correctly above: what is the rule about using LaTeX within the lua code? One option would be to disable the nested lua syntax and instead just give it a generic fixed "code" highlighting (similar to |
I just pushed an update that I think should fix the main error here. Can you update and test? I also added the |
@lervag The original mismatch problem is gone. Syntax highlighting is almost there, few points:
|
Good to hear it!
Well, this is not that simple. Loading the Lua syntax does come with a small cost, and if I do that for everyone regardless of whether it is relevant this cost will impact all users. Still, I see your point, and so we need to find a middle ground that works well. I see several paths.
This is because the So, what is the best solution here? One possibility is to attempt to hack again and allow PS! I notice your lua code looks different than mine, so I'm curiuos if you load a different lua syntax plugin than I do. If so, which plugin do you use? |
@lervag Ah, if just requires adding Regarding inconsistent syntax colors for I use lua syntax from plugin: https://github.com/tbastos/vim-lua. There is another one, though the description says they have disabled support for lower versions of Lua: https://github.com/euclidianAce/BetterLua.vim. Though don't know if that affects 5.1, which not be a great idea to not support as luaJIT supports only Lua 5.1, and a lot of the Lua users like their code to be Lua 5.1 compliant code. |
Yes, one time cost (during load); per session. But I do think this is a very minimal cost, so you probably won't care.
I'm sorry, but I did not understand that. What do you mean "add this pattern to String highlight group"; why would that solve this issue? Let's settle this one before we leave this issue.
Thanks! |
I've implemented a hack that seems to work. Let me know if you find more edge cases. |
This was hard to narrow down!
Including package luacode causes some legitimate brackets to show as if they are unbalanced/unmatched/mismatched.
command
vim -u minimal.vim minimal.tex
minimal.vim
minimal.tex
Comment the line
\usepackage{luacode}
and load vim a second time to see that the problem doesn't occur if luacode is not included.screenshot
The text was updated successfully, but these errors were encountered: