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

Adding regular expression searches #768

Open
machinedgod opened this issue Aug 29, 2024 · 1 comment
Open

Adding regular expression searches #768

machinedgod opened this issue Aug 29, 2024 · 1 comment

Comments

@machinedgod
Copy link

machinedgod commented Aug 29, 2024

Hello,
I'd like to add a feature to a search command so that it can do an extended regex search.
I already have the test regex code prepped, and I think I know where to plug it into the Vimb (command.c:105 ?). Of course, some guidance/handholding would be very useful.

If this is a patch that'd be accepted upstream, then in order to prep it properly, I have few options on my mind, once I have it working, on how to have it in Vimb:

  1. as an option in config.h - makes all searches into extended regex
  2. as a set parameter
  3. as different, alternative command
  4. as some sort of flag in the search command

I can probably deal with first two on my own, but would need some guidance on last two.

Also, just to avoid XY problem, this is the context:
today I wanted to select a piece of text from the webpage and store it in the clipboard, and realized that

  • caret function makes this very pedestrian
  • there's no way to hint a normal text, just links
  • there's no way (to my knowledge, after reading the manual) to select text without mouse OR using search
  • search doesn't support regex so I can't easily select a block of text

If there's a way to easily select text just with keyboard, please let me know 🪦
I have already started working on this (as mentioned I have regex code ready) and have started crashing vimb tinkering with command_search.

@machinedgod
Copy link
Author

machinedgod commented Aug 29, 2024

P.S. I am simply using regex.h from glibc. This is what martanne/vis uses and it works pretty flawlessly.

Update:
gonna pause this for tonight but after some more looking at the code, I realize that the search is a monolith coming from webkit, and their controller's options do not offer regex searches.
This might mean I either hack this somehow with some ugly javascript command and eval, or I might :gulp: have to see if I can plug this into webkit.

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

No branches or pull requests

1 participant