-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add the ability to disable inline math #378
Conversation
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.
This is looking good so far. I'm a little puzzled myself why the other method didn't work from you. Why don't you leave this commit as is and post another commit on top of it to this PR that shows your best stab at the expected way to make this work and we'll look into it from there and see if we can make out why id didn't go as planned?
@alerque I've added another commit to try to use Hopefully you can point me in the right direction! |
Having given this a look over but not having gotten it to work yet, I'd take a stab and guess the issue has to do with escaping the regex inside the single quotes. Did you try it with some easy to debug keyword to match the start/end to that doesn't need any sort of regex, like DEBUGSTARTMATH and DEBUGENDMATH just to see if the rest is working, then figure out how to escape the actual expression from there? |
Good idea, I'll give that a shot this weekend! |
Okay, with the latest commmit a92bba7 I've added an entry to aid with debugging. Here are my findings, formatted as a test markdown file to demonstrate the issue: # Testing inlinemath for vim-pandoc-syntax
## Working
Debug entry: DEBUGSTARTMATHthistextshouldbeconcealedDEBUGENDMATH
> The above text conceals properly, and is ignored when blacklisted (as expected).
## Not working
Using dollar signs: $thistextcannotbeignored$
Using parenthesis: \(thistextcannotbeignored\)
> The above text conceals regardless of whether it is blacklisted To reproduce:
I really wish I knew what was going on here, maybe it's something stupid and I just need a sanity check :) |
@alerque any ideas? I'm at a loss here... |
@alerque don't mean to bother as I'm sure you're very busy... just want to ping you to make sure this doesn't fall off the radar :) |
Sorry, it hasn't fallen off the radar completely but I've been pretty swamped and will be traveling for another month. I haven't had a chance to dig into this. Did you check the difference between single and double quoting strings? In Vimscript how strings are quoted affects how regular expressions are parsed. |
Fixed the problem! It has to do with the logic in the
As seen here, the Of course, not understanding this critical distinction, I had a |
ugh. nevermind. now it's still breaking things. I think it has to do with the fact that the syn call is being made at all, it's preventing other conceals from happening after a single |
Unfortunately, with what I've learned in my last few tests, I think that Not sure if y'all squash. If so I'll keep history as-is. Otherwise, let me know if you want me to rebase and clean up before it gets merged. Thanks everyone!! |
Hey @alerque I'm sure you're very very busy, just want to make sure this doesn't fall off the radar will all the new year craziness. Hope you can take a look some time soon. Thanks so much!! |
Sorry, yes this had fallen off the radar. It's still probably in notifications but I've been pulling from the top at a trickle... |
Fixes: #196
Adds an option for
inlinemath
to the blacklist variable that controls whether inline math will be concealed or not.At the moment it works but is untested and almost definitely not the right way. I feel like I should be using
WithConceal
like the other blacklist items, but when I tried to plug the twosyn region
lines intoWithConceal
it broke. So for now I am checking theindex()
of the blacklist array variable directly.Could anyone more familiar with the code point me in the right direction here? This is my first time contributing to a vim plugin :)