Support ctrl-u and ctrl-k to clear line to start/end #33

Closed
dlee opened this Issue Feb 25, 2014 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

dlee commented Feb 25, 2014

Add support for ctrl-u and ctrl-k to clear line to start and end.

Owner

garybernhardt commented Feb 26, 2014

C-k only makes sense if you can move the cursor, but Selecta intentionally doesn't support that (it would either require either using readline or reinventing readline poorly).

The behavior of C-u isn't consistent, unfortunately. Bash deletes until beginning of line; Zsh deletes the entire line; Readline's docs say it deletes until beginning of line, but it actually deletes the entire line (!). Fortunately, since Selecta doesn't support cursor movement, this ambiguity doesn't affect it. I think that having C-u delete the entire line sounds good.

The patch should be simple and parallel "backspace" completely: a new KEY_ constant, an entry in handle_key (untested) and a clear_query method on Search (tested in search_spec). I'm headed home but can probably bang it out tomorrow unless you beat me to it. ;)

garybernhardt closed this in #34 Feb 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment