-
Notifications
You must be signed in to change notification settings - Fork 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
Find text only searches part of file #6697
Comments
Thanks @PAGWatson for opening this issue 👍 This is indeed likely an issue in Notebook 7 if it works with the latest JupyterLab 4.0 pre-release. Maybe this was introduced in #6539. Would you be able to provide a screenshot to make it easier to reproduce the issue? |
Sure. As an example, one of my scripts has a function "get_color_cycle", and if I search for this in the searchbar brought up by Ctrl+F when viewing the top of the file, then it returns zero results: If I scroll down to show the function in the browser window and search again, the text is found: My guess was that the notebook is only loading the file contents near the location that is being viewed or something? For small text files and scripts, I'd guess it's generally better to load the whole thing. |
Ah interesting thanks for sharing the screenshots.
In JupyterLab, does the Ctrl-F trigger the browser search popup like in Notebook 7? Or the JupyterLab search / replace tool? |
So I looked over this bug to see if I could replicate it. I replicated it, but the question is not so much a bug as it is functionality. So the HTML search bar does not pick up on the text in the python file, but the localized, built-in jupyter notebook search bar does. I guess it is a matter of if we want the HTML search bar to be able to search the python code or not. |
Small comment: the browser search will always fail as the text editor (i.e. codemirror 6) is only rendering the text content that fits in the viewport. There are two solutions:
|
This is still an issue in the latest text-editor-search.mp4The But now that the rendering of the notebook has changed in JupyterLab (and in Notebook 7), maybe notebook/packages/documentsearch-extension/schema/notebookShellWidgetListener.json Lines 5 to 10 in 044089d
|
In that case the new default would be to open the JupyterLab search box when hitting |
@jtpio How would a user disable the shortcut? In the keyboard shortcuts menu in the settings editor, I see a way to view and add shortcuts, but can they be disabled? I didn't see an option for that with this document search shortcut (was able to see the shortcut for document search but when selecting and deleting the keys, it just goes back to its previous value)... |
Right I'm not sure it's possible to disable the shortcut via the Settings Editor UI. However it should be possible with the Advanced Settings Editor by adding disable-shortcut-notebook.mp4 |
@jtpio Thanks, I'm gonna work up documentation for this to include in the PR. |
If I open a long .py file in Notebook 7.0.0a10 and try to search for text with Ctrl+F, text only seems to be found if it appears within the portion of the file being viewed on screen, and it says there are zero instances otherwise. If I try it in jupyterlab (4.0.0a32), the text is found as long as it exists somewhere in the file, so this seems to be an issue specific to Notebook. It would be desirable to be able to search the whole of python scripts, text files etc.
The text was updated successfully, but these errors were encountered: