Brackets: Tab key should enter the selected suggestion

Created on 22 Feb 2014  路  11Comments  路  Source: adobe/brackets

If you begin to type in a CSS property, a popup will present the available properties that start with those letters, selecting the top one by default. If you hit return, it'll enter that highlighted suggestion for you. But if instead you hit tab (like one would be used to when using other IDEs), it will actually add space instead of entering the suggested property for you. Tab and return should do the same thing - auto-fill in the highlighted option.

Before:
before
After:
after

sprint 36

low priority

Most helpful comment

This is now fixed with PR #6984. Open the preferences file and add: "insertHintOnTab": true to enable it.

Closing

All 11 comments

We could maybe make _insertHintOnTabDefault a preference, can't we?

Why a preference as opposed to just making that change for everyone? In what case would you ever want it to actually add space and present that different popup?

It would be a preference because not everyone wants to insert with Tab. It started as being possible to insert with Tab and Enter, then Tab was removed (https://github.com/adobe/brackets/pull/4916), and then functions were possible to make it configurable via an extension (https://github.com/adobe/brackets/pull/5084). The only thing missing would be a preference in Brackets (https://trello.com/c/HJdgd6DF/802-common-settings-as-preferences).

Why wouldn't you want to insert with tab, and instead get whitespace and a different popup? I don't see why that'd be desirable at all.

Here are a few reasons: https://github.com/adobe/brackets/issues/4904, https://github.com/adobe/brackets/issues/4660. I think the second one is good enought reason to make this configurable and disabled by default.

BTW, there is an extension if you want to change it right now. But it should also be a preference in Brackets.

That's understandable for extensions which use the tab key for their custom behavior such as code completion, so it should be configurable by the extension. I suppose a user preference is fine for those that find themselves triggering it accidentally, but why do you think tab should add space instead of committing the selected option by default?

Yes I'd be interested to know which extension changes that. :) I'm so used to tabbing in Xcode that it's very trusting to not have that ability in Brackets. Always constantly undoing and redoing it being sure to hit return instead. One of the most annoying things that I've found. ;)

Is a matter of how people use it. Some use Enter, others want to use Tab. So if you don't use Tab and want to add a space and not use any of the code suggestions, you don't want to first close them and then use Tab, you just want to use Tab. So it needs to be a preference. Now the matter if it should be enabled by default or not, might be another issue, and might even only depend on how many people want it one way or the other.

I imagine most IDEs have it set up such that both tab and return fill in the suggestion. Xcode does but there is a difference. Tab will only complete one word at a time while return will complete the entire suggestion. So if you type "stringw" it'll suggest "stringWithFormat..." and at that point hitting tab would type in "stringWith" and update the suggestions based on that text, but if instead you hit return then it fills in the entire "stringWithFormat..." That allows control when you have names that start with the same text so you don't have to keep typing to filter the list, just tab through it. Not sure how useful that would be outside of the Objective-C language though. Anyways, I believe with Sublime Text as well, tab and return "just works."

Reviewed low priority to @TomMalbran who has a pull request #6984 to support this.

This is now fixed with PR #6984. Open the preferences file and add: "insertHintOnTab": true to enable it.

Closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rugk picture rugk  路  4Comments

edlau picture edlau  路  3Comments

TheHedge picture TheHedge  路  3Comments

Bluefirecracker picture Bluefirecracker  路  4Comments

AgamlaRage picture AgamlaRage  路  4Comments