[PATCH] Speed-up fish completion
lorenzo
geograpy at mailbox.org
Mon Dec 11 18:37:58 CET 2017
From fbf3d73a6d870d5b7324c1cc83fc3fba5d6e5483 Mon Sep 17 00:00:00 2001
From: Lorenzo Manacorda <geograpy at mailbox.org>
Date: Mon, 11 Dec 2017 18:23:19 +0100
Subject: [PATCH] Speed-up fish completion
Using the built-in fish function `string` instead of `sed` provides a
noticeable speed-up.
---
src/completion/pass.fish-completion | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/completion/pass.fish-completion
b/src/completion/pass.fish-completion
index c32a42c..961eef5 100644
--- a/src/completion/pass.fish-completion
+++ b/src/completion/pass.fish-completion
@@ -38,7 +38,7 @@ function __fish_pass_print_entry_dirs
set -l dirs
eval "set dirs "$prefix"/**/"
for dir in $dirs
- set entry (echo "$dir" | sed "s#$prefix/\(.*\)#\1#")
+ set entry (string replace -r "$prefix/(.*)\$" '$1' $dir)
echo "$entry"
end
end
@@ -47,7 +47,7 @@ function __fish_pass_print_entries
set -l files
eval "set files "$prefix"/**.gpg"
for file in $files
- set file (echo "$file" | sed "s#$prefix/\(.*\)\.gpg#\1#")
+ set file (string replace -r "$prefix/(.*).gpg\$" '$1' $file)
echo "$file"
end
end
--
2.15.1
More information about the Password-Store
mailing list