Skip to content

Implement regex search as SearchToggleOption #4098

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adrianlzt
Copy link

Implement regex search functionality as a new SearchToggleOption.

  • Add a new field regex_search to the SearchResult struct in zellij-server/src/panes/search.rs.
  • Implement regex search functionality in the search_row method of SearchResult in zellij-server/src/panes/search.rs.
  • Update the check_if_haystack_char_matches_needle method to handle regex search in zellij-server/src/panes/search.rs.
  • Add a new method toggle_search_regex to the Grid struct in zellij-server/src/panes/terminal_pane.rs to toggle regex search.
  • Update the set_search_string method in Grid to handle regex search if regex_search is enabled in zellij-server/src/panes/terminal_pane.rs.
  • Add unit tests for regex search functionality in search_row method of SearchResult in zellij-server/src/panes/unit/search_in_pane_tests.rs.
  • Add unit tests for toggle_search_regex method in Grid struct in zellij-server/src/panes/unit/search_in_pane_tests.rs.

@adrianlzt adrianlzt force-pushed the add-regex-search branch 2 times, most recently from 9f3c875 to f76a1d3 Compare March 28, 2025 05:18
* Add a new field `regex_search` to the `SearchResult` struct in `zellij-server/src/panes/search.rs`.
* Implement regex search functionality in the `search_row` method of `SearchResult` in `zellij-server/src/panes/search.rs`.
* Update the `check_if_haystack_char_matches_needle` method to handle regex search in `zellij-server/src/panes/search.rs`.
* Add a new method `toggle_search_regex` to the `Grid` struct in `zellij-server/src/panes/terminal_pane.rs` to toggle regex search.
* Update the `set_search_string` method in `Grid` to handle regex search if `regex_search` is enabled in `zellij-server/src/panes/terminal_pane.rs`.
* Add unit tests for regex search functionality in `search_row` method of `SearchResult` in `zellij-server/src/panes/unit/search_in_pane_tests.rs`.
* Add unit tests for `toggle_search_regex` method in `Grid` struct in `zellij-server/src/panes/unit/search_in_pane_tests.rs`.
@adrianlzt adrianlzt marked this pull request as draft March 28, 2025 05:38
@adrianlzt
Copy link
Author

This PR is still incomplete (some tests and highlighting errors).
Most of the heavy lifting has been done using LLMs.
I want to know if it will be a feature to be considered for merge, if so, I can continue to polish it.

zellij-regex.mp4

Closes #4097

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant