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

Prioritize tabout over next snippet placeholder #46

Open
gruvw opened this issue Mar 8, 2023 · 1 comment
Open

Prioritize tabout over next snippet placeholder #46

gruvw opened this issue Mar 8, 2023 · 1 comment

Comments

@gruvw
Copy link

gruvw commented Mar 8, 2023

Functional issue

We should have a setting (or change the default behavior, but a setting makes more sense) to prioritize the use of tab to tabout, over the use of tab for accessing the next snippet placeholder.

Example 1

Using the following snippet:

"Test": {
    "prefix": "test",
    "body": ["> $1 <, $2"],
    "description": "Testing Tab out"
}
  1. (Use a language with automatic parenthesis completion: typing ( inputs ())
  2. Type test and trigger snippet extension
  3. Input (, you should now have the following: > (|) <, (where | is your cursor)
  4. Using tab here places you on the next snippet placeholder: > () <, |

Expected behavior: you should be placed here: > ()| <,

Corner case

The described expected behavior should only happen while standing inside the current snippet placeholder!

Example 2

Using the following snippet:

"Test2": {
    "prefix": "test2",
    "body": ["$2, > $1"],
    "description": "Testing Tab out 2"
}
  1. Type (test2
  2. Trigger snippet extension, you should have the following (, > |)
  3. Pressing tab here should correctly send you to the next snippet placeholder (which is before the comman on the same line here)

This is currently functioning correctly.
I just wanted to mention it here as something to be careful not to introduce when writing a fix.

Example 3

Using the same snippet as in Example 2.

  1. Type (test2
  2. Trigger snippet extension
  3. Type (, you should have the following (, > (|))
  4. Here the expected behavior when pressing tab once is: (, > ()|) (which is not what is currently happening)
  5. Pressing tab a second time should give: (|, > ())
@Fred-Vatin
Copy link

As a workaround one could change the keybinding for tabout or for snippets jump.

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