summaryrefslogtreecommitdiff
path: root/etc/functions/whichf
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions/whichf')
-rwxr-xr-xetc/functions/whichf7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/functions/whichf b/etc/functions/whichf
index dc8d04b..01026c4 100755
--- a/etc/functions/whichf
+++ b/etc/functions/whichf
@@ -1,2 +1,7 @@
## vim:ft=zsh
-echo ${^fpath}/$1(-.N)
+## locate the file corresponding to a function
+if [[ -n $(echo ${^fpath}/$1(-.N)) ]] {
+ echo ${^fpath}/$1(-.N)
+} else {
+ return 1
+}