brackets-userland/brackets-snippets

Tabbing Issues

TomMalbran opened this issue · 7 comments

I found a couple of issue while tabbing through the editable fields in a snippet.

  1. If I am on the last field and I press tab, I tab outside of the snippet editor. I would expect to go back to the first field. Same if I shift-tab from the first field. It might need another shortcut to exit from the editor.
  2. If I tab and I left the field empty, I think that it should still display the placeholder.
  3. If a snippet has multiple fields with the same name, and you already completed it once, maybe tabbing should skip it. Might be debatable.
  1. Fixed - you can't Tab out of the widget now, Esc key closes the widget, Enter key finishes snippet inserting.
  2. Fixed
  3. Tab will now go to the next empty variable if there's one, or behave normally if all are filled.

Also see https://github.com/zaggino/brackets-snippets#keyboard

Brackets Snippets (by zaggino) updated to version 0.1.1.

Thanks. It is working better now :)

For 3 that is a good option.

Cool :) Let me know if you run into any more issues.

I have a couple suggestions, but not sure if you have them planned for later:

  1. It would be awesome to have an actual editor when showing the snippet. This might be hard to do, but it will make the code easier to read. I guess that when saving the snippets we can give them an extension, so that we know the mode. The editor could be as read only, but with inputs to be able to modify the parameter (not sure how this last part can be done).
  2. it might be cool to write in one line the name of the snippet and then the variables and after pressing Alt-S you get the snippet pasted without going through the inline editor. If there are variables missing, the snippets editor opens on the snippet selected and the cursor placed on the first unfilled parameter.

I can open new issues for those if you want.

I've done that just now and I'll look into it :) Suggestions are always welcome.