[gvfs] completion: Use __ltrim_colon_completions



commit 27809fc426d94189629b4eaae10f7080e5b6ea23
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Jun 18 09:59:22 2015 +0200

    completion: Use __ltrim_colon_completions
    
    Use macro __ltrim_colon_completions to remove colon prefix instead
    of custom code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751145

 programs/completion/gvfs-cat |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/programs/completion/gvfs-cat b/programs/completion/gvfs-cat
index 2226d10..51621ac 100755
--- a/programs/completion/gvfs-cat
+++ b/programs/completion/gvfs-cat
@@ -31,18 +31,9 @@ __gvfs_multiple_uris() {
     COMPREPLY=($(compgen -W '$(gvfs-ls --show-completions "$cur")' -- ""))
 
     # don't misbehave on colons; See item E13 at http://tiswww.case.edu/php/chet/bash/FAQ
-    # We handle this locally be extracting any BLAH: prefix and removing it from the result.
+    # The macro below handles this by extracting any BLAH: prefix and removing it from the result.
     # Not great, but better than globally changing COMP_WORDBREAKS
-
-    case "$cur" in
-       *:*)
-           case "$COMP_WORDBREAKS" in
-               *:*) colon_prefix=$(echo $cur | sed 's/:[^:]*$/:/' )
-                   COMPREPLY=${COMPREPLY##${colon_prefix}}
-                   ;;
-           esac
-           ;;
-    esac
+    __ltrim_colon_completions "$cur"
 }
 
 ####################################################################################################


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]