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

Optimize the wrapper to search context in only the file displayed on "Detail" view of "Nodes" tab #1

Closed
KarlHeitmann opened this issue Jan 12, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@KarlHeitmann
Copy link
Owner

On the "Detail" view, you will see the all the matches inside a specific file (each file with matches is the "node" struct) (in this case the search term was "fn"). You will see inside the "Detail" table each line match with 1 line before and after as context. If you hit left or right arrow, the context will span less of more lines of context around each match.

rip_grep_detail

If you are working on a real world application, with thousands of files, each time you hit the left or right arrow key, rg_explorer will do the search with rip grep again inside all files of the folder. If you quickly hit 5 times the right arrow key to get +5 lines of context around the match you are seeing in the detail window, rg_explorer will perform 5 times the same search on your source code. This will definitively produce some lag on the application and burn some CPU. But you are interested in only one file.

Fix this problem by performing the search only within the selected file.

@KarlHeitmann KarlHeitmann added good first issue Good for newcomers enhancement New feature or request labels Jan 12, 2023
@KarlHeitmann KarlHeitmann added help wanted Extra attention is needed and removed good first issue Good for newcomers labels Jan 19, 2023
KarlHeitmann added a commit that referenced this issue Jan 20, 2023
…nge_context_only_current_file-alt1

This solves issue #1 , when you hit the left/right arrow key in the `Nodes` tab, you will update the context only for the Node you are viewing on the Detail widget.
@KarlHeitmann
Copy link
Owner Author

#10 closes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant