From: Simon Ruderich Date: Sat, 23 Jan 2016 23:42:18 +0000 (+0100) Subject: support $match->{handler} to overwrite handler for certain matches X-Git-Url: https://ruderich.org/simon/gitweb/?p=fcscs%2Ffcscs.git;a=commitdiff_plain;h=b7bf6ac5054d4023bacff64a392218675c008921 support $match->{handler} to overwrite handler for certain matches E.g. a different handler for YouTube URLs to automatically download the video. --- diff --git a/bin/fcscs b/bin/fcscs index e2a89b7..9c33fe9 100755 --- a/bin/fcscs +++ b/bin/fcscs @@ -1212,6 +1212,7 @@ RESULT: debug \%config, 'input', 'running handler'; my $handler = $config{state}{handler}; # set by user + $handler = $result->{match}->{handler} unless defined $handler; # set by match $handler = $result->{handler} unless defined $handler; # set by mapping $handler = $config{handler}{yank} unless defined $handler; # fallback $handler->($screen, \%config, $result->{match});