aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/tools/find.nom9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tools/find.nom b/lib/tools/find.nom
index 3e26ef4..bfd4583 100755
--- a/lib/tools/find.nom
+++ b/lib/tools/find.nom
@@ -80,11 +80,16 @@ command line program with $args:
for $t in recursive $tree:
if ($t matches $pattern_tree):
$line_num = ($file, line number at $t.source.start)
+
+ $source = (source lines of $t)
+ $indent = ($source, matching "^ *")
+ $source = ($source, from (#$indent + 1), with "\n\$indent" -> "\n")
+
$results, add {
.line = $line_num
.text = ("
\(blue "\$filename:\$line_num:")
- \(source lines of $t)
+ \$source
")
}
@@ -98,4 +103,4 @@ command line program with $args:
..else:
sort $results by $ -> $.line
for $ in $results:
- say $.text \ No newline at end of file
+ say $.text