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

[advice] Change conceal regular expression #2178

Closed
Freed-Wu opened this issue Sep 23, 2021 · 3 comments
Closed

[advice] Change conceal regular expression #2178

Freed-Wu opened this issue Sep 23, 2021 · 3 comments

Comments

@Freed-Wu
Copy link
Contributor

In https://hub.fastgit.org/lervag/vimtex/blob/master/autoload/vimtex/syntax/core.vim#L1376

syntax match texMathSymbol "\\sum\>"               contained conceal cchar=

"\\sum\>" is too strict, it cannot match \sum_{i = 1}^n or \sum^n_{i = 1}

How about change it to "\\sum\ze\(\>\|_\|\^\)"?

Other operators are similar.

Thanks!

@lervag
Copy link
Owner

lervag commented Sep 23, 2021

Other operators are similar.

You're right. But I'm not sure it makes sense to change all operators. Would you mind proposing a set of the relevant operators? Or do you think it would be better to simply change all related regexes?

@Freed-Wu
Copy link
Contributor Author

In my opinion, I believe it should not have any side effect. However, if it results in any bug for some operators, we can treat these operators specially.

lervag added a commit that referenced this issue Sep 23, 2021
@lervag
Copy link
Owner

lervag commented Sep 23, 2021

I've updated this now. I think it should work as expected in most or all cases now, but please test and report any errors.

@lervag lervag closed this as completed Sep 23, 2021
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

2 participants