aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdwim12
1 files changed, 7 insertions, 5 deletions
diff --git a/dwim b/dwim
index a5d8030..a3224cb 100755
--- a/dwim
+++ b/dwim
@@ -42,14 +42,16 @@ for ($phrase) {
run @MAILER, $1
}
- if (/^(.+?):(\d+).*?$/) {
- handle 'file:line (like grep -n)';
+ if (/^(.+?):(\d+|\/\S+)/) {
+ handle 'file:line/query (like grep -n)';
my $p = path $1;
- run @EDITOR, "+$2", $p
+ my $q = $2;
+ $q =~ s/\)$//;
+ run @EDITOR, "+$q", $p
}
- if (/^(.+) line (\d+)\.?$/) {
- handle 'FILE line LINE (like perl)';
+ if (/^(.+) line (\d+)/) {
+ handle '<file> line <line> (like perl)';
my $p = path $1;
run @EDITOR, "+$2", $p
}