]> cloud.milkyroute.net Git - dolphin.git/commitdiff
dolphin.zsh: complete both directories and URL protocols
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Thu, 29 Feb 2024 17:56:53 +0000 (20:56 +0300)
committerMéven Car <meven.car@kdemail.net>
Fri, 8 Mar 2024 17:01:03 +0000 (17:01 +0000)
Dolphin is mostly used for navigating local paths (or remote paths
mounted locally), so it is important to have directories completed as
well as URLs

completions/dolphin.zsh

index 3433c5496712d8be96fba60bacf9d13cafc8a151..87971a854fecef6095912374b5f26e5ac5f92909 100644 (file)
@@ -6,13 +6,19 @@
 
 local ret=1
 
+# complete both URL protocols and local directories
+_urls_and_dirs() {
+  _urls
+  _directories
+}
+
 _arguments -C \
   '(* -)'{-h,--help}'[Displays help on commandline options]' \
   '--select[The files and folders passed as arguments will be selected.]' \
   '--split[Dolphin will get started with a split view.]' \
   '--new-window[Dolphin will explicitly open in a new window.]' \
   '--daemon[Start Dolphin Daemon (only required for DBus Interface).]' \
-  '*:: :_urls' \
+  '*:: :_urls_and_dirs' \
   && ret=0
 
 return $ret