]> ruderich.org/simon Gitweb - fcscs/fcscs.git/blobdiff - bin/fcscs
fix typo in comment
[fcscs/fcscs.git] / bin / fcscs
index e3d39cb7ae5251b590451df7e853deb202dccbd6..a2a95b7d567e15b90d9f404b7abc02b506921027 100755 (executable)
--- a/bin/fcscs
+++ b/bin/fcscs
@@ -102,8 +102,7 @@ or another number to select the longer match. Use backspace to remove the last
 entered number.
 
 Press return before entering a number to select the last (lowest numbered)
-match (underlined by default). To abort without selecting any match either use
-"q".
+match (underlined by default). To abort without selecting any match use "q".
 
 To change the selection mode (e.g. paths, files, etc.) use one of the mappings
 explained below. Per default URLs are selected, see options for a way to
@@ -501,8 +500,8 @@ sub run_in_background {
         # closes the window (because the parent process has exited).
         local $SIG{HUP} = 'IGNORE';
 
-        # Necessary for GNU screen or it'll keep the window open until the
-        # paste command has run.
+        # Necessary for GNU screen or it'll keep the window open until an
+        # external command has run.
         close STDIN  or die $!;
         close STDOUT or die $!;
         close STDERR or die $!;
@@ -553,7 +552,8 @@ sub select_match {
             $number = $number * 10 + $char;
         } elsif ($char eq "\b" or $char eq "\x7f") { # backspace
             $number = int($number / 10);
-        } elsif ($char eq "\n") {
+        } elsif ($char eq "\n"
+                or $char eq $config->{setting}{alternative_return}) {
             if ($number == 0) { # number without selection matches last entry
                 $number = 1;
             }
@@ -631,8 +631,9 @@ sub extend_match {
         my $match_old = \%{$match};
 
         my $char = $screen->getch;
-        if ($char eq "\n") { # accept match
-            last;
+        if ($char eq "\n"
+                or $char eq $config->{setting}{alternative_return}) {
+            last; # accept match
 
         } elsif ($char eq 'w') { # select current word (both directions)
             extend_match_regex_left($line,  $match, qr/\w+/);
@@ -1017,6 +1018,16 @@ The following simple mappings are available by default:
 
 =back
 
+The following additional mappings are available by default:
+
+=over
+
+=item B<\n> accept current selection (not customizable)
+
+=item B<s>  additional key to accept selection (B<alternative_return> option)
+
+=back
+
 All (single-byte) keys except numbers, backspace and return can be mapped.
 
 Unknown mappings are ignored when pressing keys.
@@ -1101,6 +1112,8 @@ Defaults in parentheses.
 
 =item B<screen_msgwait> GNU Screen's msgwait variable, used when yanking (C<5>)
 
+=item B<alternative_return> additional accept key like return, set to C<\n> to disable (C<s>)
+
 =item B<browser>        browser command as array reference (C<['x-www-browser']>)
 
 =back
@@ -1120,6 +1133,8 @@ my %setting = (
     smartcase      => 1,
     paste_sleep    => 100_000,
     screen_msgwait => 5,
+    # global mappings
+    alternative_return => 's',
     # commands
     browser        => ['x-www-browser'],
 );