Add action to focus query editor widget#94799
Merged
JacksonKearl merged 8 commits intomicrosoft:masterfrom Apr 10, 2020
Merged
Conversation
JacksonKearl
suggested changes
Apr 9, 2020
Contributor
JacksonKearl
left a comment
There was a problem hiding this comment.
Looks good, just a few minor changes.
| 'Search Editor: Search Again', category); | ||
|
|
||
| registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusQueryEditorWidgetAction, FocusQueryEditorWidgetAction.ID, FocusQueryEditorWidgetAction.LABEL), | ||
| 'Search Editor: Focus Query Editor Widget', category); |
Contributor
There was a problem hiding this comment.
I'd default this to be bound to Escape, then we can remove the existing line binding it to Escape in searchEditor.ts and instead use only this. That way people that want to use Escape for other things aren't conflicting.
| if (viewState && viewState.focused === 'editor') { | ||
| this.queryEditorWidget.searchInput.focus(); | ||
| } else { | ||
| this.searchResultEditor.focus(); |
Contributor
There was a problem hiding this comment.
No real need to make this toggle, it can simply call this.queryEditorWidget.searchInput.focus();
| 'Search Editor: Search Again', category); | ||
|
|
||
| registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusQueryEditorWidgetAction, FocusQueryEditorWidgetAction.ID, FocusQueryEditorWidgetAction.LABEL, | ||
| { mac: { primary: KeyCode.Escape } }, ContextKeyExpr.and(SearchEditorConstants.InSearchEditor)), |
Contributor
There was a problem hiding this comment.
This can just be { primary: KeyCode.Escape }, rather than being mac specific. Some of the other bindings are macOS specific because Windows binds them to system commands, but that isn't the case here.
JacksonKearl
approved these changes
Apr 10, 2020
Contributor
|
Looks good, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #94439