emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/bash-completion 9583153e0b 068/313: Fixed issue with wordb


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 9583153e0b 068/313: Fixed issue with wordbreak character being the first character
Date: Sat, 3 Dec 2022 10:59:17 -0500 (EST)

branch: elpa/bash-completion
commit 9583153e0ba99a5158c79a8f14fd7ff62006afa8
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Fixed issue with wordbreak character being the first character
---
 bash-completion.el      | 4 ++--
 bash-completion_test.el | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index ef8d80c201..5dccc8cb5b 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -190,7 +190,7 @@ This function is not meant to be called outside of
       (bash-completion-send (concat
                             (bash-completion-cd-command-prefix)
                             "compgen -o default -- "
-                            after-wordbreak))
+                            (bash-completion-quote after-wordbreak)))
       (comint-dynamic-simple-complete
        after-wordbreak
        (bash-completion-extract-candidates after-wordbreak)))))
@@ -664,7 +664,7 @@ Wordbreaks characters are defined in 
'bash-completion-wordbreak'.
 Return a CONS containing (before . after)."
   (catch 'bash-completion-return
     (let ((end (- (length str) 1)))
-      (while (> end 0)
+      (while (>= end 0)
        (when (memq (aref str end) bash-completion-wordbreaks)
          (throw 'bash-completion-return (cons (substring str 0 (1+ end)) 
(substring str (1+ end)))))
        (setq end (1- end))))
diff --git a/bash-completion_test.el b/bash-completion_test.el
index 2d10eb5645..24637c07f6 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -424,10 +424,12 @@ garbage
        (bash-completion-last-wordbreak-split "a:b:c:d:e")
        (bash-completion-last-wordbreak-split "hello=world")
        (bash-completion-last-wordbreak-split "hello>world")
+       (bash-completion-last-wordbreak-split ">world")
        (bash-completion-last-wordbreak-split "hello"))
       '(("a:b:c:d:" . "e")
        ("hello=" . "world")
        ("hello>" . "world")
+       (">" . "world")
        ("" . "hello")))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]