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

Superscript Auto-Enclosure deletes normal parentheses. #71

Closed
wobbba opened this issue Oct 19, 2022 · 2 comments
Closed

Superscript Auto-Enclosure deletes normal parentheses. #71

wobbba opened this issue Oct 19, 2022 · 2 comments

Comments

@wobbba
Copy link

wobbba commented Oct 19, 2022

If I press space after typing A^(b) it results in A^{b} but I expect it to be A^{(b)}, as is also the case with the subscript version.

@joeyuping
Copy link
Owner

Hi! @wobbba

Thank you so much for bringing this up! Indeed, I did not consider this usage.
I have updated the plugin, please kindly update to v2.5.0.
I added a conditional to check that if expression after superscript is enclosed in round brackets () AND enclosed content is more than 3 characters then replacing the () brackets is performed. The replacing brackets operation is retained as it is for cases when the exponential is a long expression that may include spaces which would prematurely trigger the enclose superscript function ; by using () after the ^ sign, the triggering of autoenclose superscript function is suppressed until cursor moves after the ().
For the case you have mentioned, I presumed it would be mostly for indexing? which most likely would not be more than 3 characters?
Please see if the changes suits the need :)

The subscript version currently does not have the () replacing function as subscript tends to be short.

@wobbba
Copy link
Author

wobbba commented Oct 25, 2022

Thank you so much @joeyuping!!

Yes this suits my needs. It is indeed a form of indexing, it pops up in some mathematics but for me mostly in machine learning. Good job on the compromise!

@wobbba wobbba closed this as completed Oct 25, 2022
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