From c0044f47f9e70067b05894280e2c231a35096bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 19 Jun 2021 23:16:52 +0200 Subject: Improve function(call handler --- dwim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dwim b/dwim index c958585..b171ee6 100755 --- a/dwim +++ b/dwim @@ -77,10 +77,11 @@ for ($phrase) { if (/^([A-Za-z_][A-Za-z0-9_]*)\(/) { handle 'function(call'; my $dir = dir; - s/\(.*//; + s/\(.*/(/; for (`grep -n '^$_' "$dir"/*.c "$dir"/*.h`) { run @EDITOR, "+$2", $1 if /([^:]+):(\d+):/; } + fail 'could not find definition'; # FALLTHROUGH } -- cgit v1.2.3