From: Francois Fleuret Date: Mon, 16 Mar 2009 20:38:45 +0000 (+0100) Subject: Added the ^U key to erase the pattern. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=50710a40445f3a2b25bfbc5b484abb7c5a0ee893;p=selector.git Added the ^U key to erase the pattern. --- diff --git a/selector.1 b/selector.1 index 81c4aa4..a4a436f 100644 --- a/selector.1 +++ b/selector.1 @@ -28,8 +28,8 @@ PageUp and PageDown move by ten lines. The Home and End key move to the top and the bottom of the list respectively. The return key selects the current line and exits. -You can cancel the selection either by interrupting the command with -^C or by typing ^G. +The ^U key erases the current pattern, and you can cancel the +selection by either interrupting the command with ^C or by typing ^G. .SH "OPTIONS" .IP "\fB-h\fP" 10 diff --git a/selector.cc b/selector.cc index e21025f..c6cf64c 100644 --- a/selector.cc +++ b/selector.cc @@ -629,6 +629,11 @@ int main(int argc, char **argv) { use_regexp = !use_regexp; } + else if(key == '') { + patterns_point = 0; + patterns[patterns_point] = '\0'; + } + else if(key == KEY_DOWN || key == '') { motion = 1; }