-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Add local search in buffer #13053
base: master
Are you sure you want to change the base?
feat: Add local search in buffer #13053
Conversation
Grep search through a local buffer similar to `global_search`. The method works but it should be improved by someone more experienced.
Showing the path to the file in the global search picker where there can be lots of files makes sense. But here it doesn't really make sense, because you're searching in the same file - so all picker items will show the same path Maybe instead of showing the path, show the line number and the string contents of that line in the 2nd column |
As per review comments of helix maintainers, - The filename and directory path was hidden for local_search - The : colon separator was also hidden since it is not required
@nik-rev Thank you for your feedback. I was able to implement and push the changes you requested. Here is the result. On another note, I also found a bug that needs to be fixed. The I will try to fix it. |
Nice! So you have a "line number" column. What about having a 2nd column for "text on that line"? Since there is quite a lot of whitespace |
I agree that having the "text on the current line" being displayed with the search result will be helpful. Since I'm new to hacking on helix I do not know how to extract the data from the buffer right now. Once I know how to extract the data I can display it by modifying the contents of I will try to look into this and implement this. Any help regarding which file/struct/variable contains the buffer text data so I can extract (clone) it will be helpful. Thank you. |
You have access to a |
Hi everyone,
I added a feature to do local search in the currently opened document buffer to improve user experience.
This feature is similar to
global_search
but is only limited to one document.The command is activated by
space+l
and seems to work well.Kindly review and allow this feature to be merged.
Thank you
~oxcrow
Reasoning
global_search
method is quite nice since it works in a fuzzy finding method and provides a table of matches that we can easily preview to find what we want.global_search
however it produces too many false positive results from other files, which makes it difficult to use./
does not feel very good to use.Implementation
global_search
and modified it little bit.