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

feat: improve search bar behavior when using key bindings #2074

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

iscle
Copy link
Contributor

@iscle iscle commented Dec 31, 2023

Before, the search bar would toggle when using the key binding to trigger it (Ctrl + f), which was quite annoying. Now, it replicates IntelliJ's search bar behaviour.

1.1. If the user has selected text, use that as the search text
1.2. Otherwise, use the previous search text (or empty if none)
2. Select all text in the search bar and give it focus

Before, the search bar would toggle, which was quite annoying. Now, it replicates IntelliJ's search bar behaviour.

1.1. If the user has selected text, use that as the search text
1.2. Otherwise, use the previous search text (or empty if none)
2. Select all text in the search bar and give it focus
searchField.selectAll();
searchField.requestFocus();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was changed so that we don't request focus before having all the text selected (for fast keyboard users :P)

@skylot skylot merged commit faeae08 into skylot:master Jan 5, 2024
5 checks passed
@skylot
Copy link
Owner

skylot commented Jan 5, 2024

@iscle thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants