From 50710a40445f3a2b25bfbc5b484abb7c5a0ee893 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 16 Mar 2009 21:38:45 +0100 Subject: [PATCH] Added the ^U key to erase the pattern. --- selector.1 | 4 ++-- selector.cc | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.39.5