Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Allow context around tab stops #126

Open
tinloaf opened this issue Apr 7, 2015 · 2 comments
Open

Allow context around tab stops #126

tinloaf opened this issue Apr 7, 2015 · 2 comments

Comments

@tinloaf
Copy link

tinloaf commented Apr 7, 2015

Hi,

I have a couple of snippets like the following:

func(${1:arg1}, arg2 = ${2:defaultValue})

Now, you sometimes do not want to set arg2. In Python for example, it can make a difference whether you omit an argument or set it to its default value.
Thus, when I reach tab stop 2 and hit "delete" or "backspace", I would like ", arg2 =" to disappear with it.

I would offer to implement this, but I'm not sure how to expand the tab stop syntax without breaking compability.

@soren-n
Copy link
Contributor

soren-n commented Apr 7, 2015

Hey tinloaf,

As a temporary fix, the behavior you describe could be emulated with an extra tabstop:

func(${1:arg1}${2:, arg2 = ${3:defaultValue}})

After pressing tab the second time, everything after the comma would be selected and ready to be deleted if not needed. The third tabstop would be deleted along with it.

**Edit:
Just noticed however, the above snippet tiggers a bug where the tab marker for the second tabstop is not updated as you write text for the first tabstop. Though i do believe the above snippet to be valid.

@steveoh
Copy link

steveoh commented Jun 3, 2015

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants