From c36d802dda7c9797fbf8bbd3dce1e413ccb20bb5 Mon Sep 17 00:00:00 2001 From: mk2 Date: Fri, 29 Nov 2019 21:57:11 +0900 Subject: [PATCH] Move __fish_complete_file_url to evince.fish --- share/completions/evince.fish | 20 +++++++++++++++++++ share/functions/__fish_complete_file_url.fish | 20 ------------------- 2 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 share/functions/__fish_complete_file_url.fish diff --git a/share/completions/evince.fish b/share/completions/evince.fish index cc1e048e6..4324949ea 100644 --- a/share/completions/evince.fish +++ b/share/completions/evince.fish @@ -1,4 +1,24 @@ +function __fish_complete_file_url + set -l comp + + if set -q argv[1] + set comp $argv[1] + else + set comp (commandline -ct) + end + + set -l prefix (echo $comp|cut -c 1-7) + + if test file:// = $prefix + set -l stripped (echo $comp|cut -c 8-) + printf "%s\n" file://(complete -C"echo $stripped") + else + echo file:// + end + +end + complete -c evince -a '(__fish_complete_file_url)' complete -c evince -s p -l page-label -d "The page of the document to display" -x complete -c evince -s f -l fullscreen -d "Run evince in fullscreen mode" diff --git a/share/functions/__fish_complete_file_url.fish b/share/functions/__fish_complete_file_url.fish deleted file mode 100644 index c19df569e..000000000 --- a/share/functions/__fish_complete_file_url.fish +++ /dev/null @@ -1,20 +0,0 @@ - -function __fish_complete_file_url - set -l comp - - if set -q argv[1] - set comp $argv[1] - else - set comp (commandline -ct) - end - - set -l prefix (echo $comp|cut -c 1-7) - - if test file:// = $prefix - set -l stripped (echo $comp|cut -c 8-) - printf "%s\n" file://(complete -C"echo $stripped") - else - echo file:// - end - -end