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

[FEATURE] More than 9 tab stops #255

Closed
git-wil opened this issue Feb 12, 2024 · 0 comments
Closed

[FEATURE] More than 9 tab stops #255

git-wil opened this issue Feb 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@git-wil
Copy link
Contributor

git-wil commented Feb 12, 2024

Description of the Problem

Currently, there is no way to have snippets expand to have more than 10 unique tabstops, because the code to parse tabstops only parses a single digit after the dollar sign indicating the start of a tabstop. While this might not normally be very useful to many, with the introduction of function snippets, it is now easier than ever to create dynamically sized snippet outputs that can use many more than 10 tabstops, such as a large matrix.

Description of the Solution

While I do not believe changing the default implementation of $ followed by a single digit for tabstops (because this would significantly break existing snippets), I propose to only modify the placeholder tabstop functionality to allow for tabstop numbers that are as long as necessary. Existing placeholder tabstops are parsed using the format ${X:YYY} where X is a single digit and YYY is the replacement string. The current code for parsing these stops detects the prefix ${ and then looks for exactly one digit followed by a colon, and then parses the rest of the replacement string after. The only change that would need to be included is modifying the parser code to split the tabstop by the colon, and parse all text on the left as a multi-character number and all text on the right as the replacement string.

Additional Comments

While there do already exist ways to create matrices with the matrix-shortcut feature, there exists some difficulty when using tab to add ampersands inside of a matrix and using tab to tabout of the current expression. That is, every time I try to add ampersands to my matrices using tab, I have to click tab several times to get rid of the backlog of tabstops that I skipped in order to actually produce the ampersand. I've already submitting another ticket for this issue, and while they are both important issues, this modified tabstop numbering feels easier to address more quickly and would be a useful feature for all.

I plan on submitting a pull request with suggested changes to the placeholder tabstop code soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants