hstr icon indicating copy to clipboard operation
hstr copied to clipboard

Use readline to edit the pattern

Open pknowles opened this issue 7 years ago • 2 comments

There are lots of little features such as a cursor position, home/end, delete-word, ctrl-arrows to move by words, which would take a lot of effort to replicate reliably. Switching to readline might be an easy way to add these features for free.

Using rl_callback_read_char in particular should allow the selection to be updated interactively: https://tiswww.case.edu/php/chet/readline/readline.html#SEC41

The pattern is currently built by looping over wgetch(), but it seems readline expects different control characters, i.e. from rl_getc(stdin). The painful part will be remapping the special characters to select matches and change options. I'll keep looking into it.

pknowles avatar Jul 30 '17 02:07 pknowles

This suggestions would solve a number of user enhancement requests - @pknowles thank you!

dvorka avatar Jan 26 '18 10:01 dvorka

Anything about this?

hugows avatar Feb 03 '22 10:02 hugows