-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support find widget in notebooks #13982
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- After step by step replacement => 'NaN of [number]' appeared in find widget, then 'find' is not working at all anymore.
Reproduce: find and replace all occurrences step by step until there is finally 'No Results' in counter field. Change to the find input again and begin to type. 'NaN of [number of occurrences]' appears and highlighting does not work anymore. - If the last occurrence has been replaced (if available, for example if "great" is replaced with "super great"), it must jump back to the first occurrence. At the moment the search remains at the last occurrence.
- pasting a search term from clipboard into find input does not work
- When playing around with markdown: if markdown is rendered it sometimes doesn't find occurrences when using match case, word boundaries and/or regex, (unfortunately I can't find a reliable way to reproduce it but maybe it has something to do with the currently pretty suboptimal API you've mentioned)
- - [ ] CMD-Option-F resp. Strg-Alt-F does not work (should open 'find and replace')
Thanks @jbicker, I believe I fixed every discovered issue except for one:
This one isn't supported in VS Code (in notebooks) and I'm not sure adding a keybinding for this is a good idea. It might accidentally break some keybindings that I'm not aware of. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Everything works as expected.
What it does
Adds support for a monaco-like find widget to the notebook widget.
How to test
The search widget can be brought up by pressing
Ctrl+F
inside of any area of the notebook widget. Having the Jupyter Keymaps extension installed also allows to bring it up by just pressingF
outside of an editor area (while the notebook widget is focused).Multiple test scenarios:
Ctrl+F
. The selected text should be placed as the initial search value of the find widget.Follow-ups
Known issues:
The current API is pretty suboptimal (especially for finding matches inside of rendered markdown cells). I plan to get back to this later to revise the API and extract a common
FindWidget
that can be used by any widget.Review checklist
Reminder for reviewers