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

Only overwrite Ctrl-f when text is focussed #988

Merged
merged 2 commits into from
Aug 26, 2020
Merged

Only overwrite Ctrl-f when text is focussed #988

merged 2 commits into from
Aug 26, 2020

Conversation

juliusknorr
Copy link
Member

Summary

Otherwise the unified search does not trigger properly if a rich workspace is shown. With this PR the browser default search will be only triggered by text if the keydown event is triggered on the editor input.

Using the regular fallback with hitting Ctrl-F twice would not work here since when editing in the viewer the unified search is hidden in the background and therefore the user doesn't get any feedback when hitting ctrl-f for the first time. Also when having the text focused I think that searching in it is a sane default.

@azul
Copy link
Contributor

azul commented Aug 26, 2020

Code looks good to me.

🧐 Minor nitpick: Keymap class sounds very generic and behaves generic in that all of it's behaviour is specified through the options during construction. At the same time it now implements special treatment for ctrl-f. Seems counter intuitive that by adding a keymap to the editor that handles mod-s you also get special treatment for ctrl-f.

Maybe put the plugin into a separate class like BrowserSearch or so?

Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

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

Confirmed that it fixes the issue in files.
Keeps using browser search when opening a file in the viewer and looking at the sidebar. I think that is the behavior we want.

I have not played with this in talk.

@juliusknorr juliusknorr merged commit c17ef69 into master Aug 26, 2020
@juliusknorr juliusknorr deleted the bugfix/802 branch August 26, 2020 13:38
@juliusknorr
Copy link
Member Author

/backport 52a20e2 to stable19

@juliusknorr
Copy link
Member Author

/backport 52a20e2 to stable18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Show rich workspaces' breaks CTRL+F
2 participants