Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the Find/Replace widget, labels for the "Replace" and "Replace All" buttons don't show keybindings #2004

Closed
ghost opened this issue Jan 14, 2016 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@ghost
Copy link

ghost commented Jan 14, 2016

In the Find widget, the "Previous match" and "Next match" buttons have labels which include their associated keybindings in parentheses. The "Replace" and "Replace All" buttons in the Replace Input box don't display keyboard shortcuts.

I looked into this a bit before creating an issue, and the solution isn't the simple "look up keybinding --> add to label" approach that I hoped for. It looks like Replace and Replace All don't actually have keybindings defined. Instead, the keys are hardcoded into the _onReplaceInputKeyDown() method of findWidget.ts.

I would like to see Replace and Replace All get configurable keyboard shortcuts. The defaults would come from the existing hardcoded values, so the core functionality would be unchanged. With configurable keyboard shortcuts it would be easier to display them cleanly on the Replace and Replace All buttons, and we get some flexibility as a free bonus.

I would like to implement this and submit a PR, but wanted to document and perhaps discuss the issue first to make sure that sort of contribution would be OK. Some comments in #406 brushed up against what I'm suggesting here, but I didn't find any other potential duplicate issues.

@isidorn
Copy link
Contributor

isidorn commented Jan 14, 2016

I know the find widget is undergoing some reconstruction but @alexandrudima is better to comment on this

@alexdima
Copy link
Member

@ajkerrigan PR welcome! 👍

I don't have any big changes planned in the find widget anymore, perhaps only to address feedback in #1476 (to move the match count outside the find input), but that shouldn't prevent you from doing a PR :).

I would suggest the following:

  • add two new commands in findController.ts (similar to CloseFindWidgetCommand)
  • maybe you have ideas for default keybindings for them that don't collide with others, otherwise they would be fine even without any keybindings
  • use the new ids to lookup their keybindings for the labels when the widget is constructed in findWidget.ts

Looking forward to the PR! 👍

alexdima added a commit that referenced this issue Jan 25, 2016
Add keybinding options for Replace and Replace All (#2004)
@alexdima alexdima added this to the Jan 2016 milestone Jan 26, 2016
@alexdima
Copy link
Member

Thank you for the PR!

@alexdima alexdima added feature-request Request for new features or functionality editor labels Jan 26, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants