atom / snippets

Atom snippets package
MIT License
204 stars 102 forks source link

Add scope/class to DOM while next tab stop exists #130

Open coopermaruyama opened 9 years ago

coopermaruyama commented 9 years ago

When I'm trying to go to the next tab stop (by pressing tab) I often get unwanted behavior due to other packages using the same key. I noticed that Atom adds a .has-selection class to atom-text-editor in the DOM if some text is highlighted, so I've used that scope to override tab and ensure only snippets:next-tab-stop is executed.

However, if I need to change the value of something while going through tab-stops, .has-selection selector is deactivated so it's not really a great solution. If you can add something like next-tab-stop-exists as a class while another tab stop exists, I think it would be a great enhancement as it would solve this issue and offer more flexibility to user without affecting other packages.