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

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

[elpa] master 964eb48 42/62: Fixed bug in completion


From: Ian Dunn
Subject: [elpa] master 964eb48 42/62: Fixed bug in completion
Date: Sat, 9 Dec 2017 14:34:03 -0500 (EST)

branch: master
commit 964eb4846e196d0a4cd3dfb90dda19e2f7283750
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>

    Fixed bug in completion
    
    * paced.el (paced-dictionary-fix-completion-case): Fix use of mapcar.
    
    * paced-tests.el (paced-completions-try-completion-mixed-case): New test.
---
 paced-tests.el | 13 +++++++++++++
 paced.el       |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/paced-tests.el b/paced-tests.el
index 16c80f6..ada02f3 100644
--- a/paced-tests.el
+++ b/paced-tests.el
@@ -400,6 +400,19 @@
     (let ((completions (paced-dictionary-completions test-dict "o" nil)))
       (should (equal completions '("o"))))))
 
+(ert-deftest paced-completions-try-completion-mixed-case ()
+  (let* ((paced--registered-dictionaries paced-test-default-registered-map)
+         (paced-global-dict-enable-alist '((text-mode . "test-dict-case")))
+         (cmd (paced-file-population-command :file paced-first-test-file))
+         (test-dict (paced-make-dictionary "test-dict-case"
+                                           paced-test-dict-save-file
+                                           'mixed-case)))
+    (should (paced-dictionary-p test-dict))
+    (oset test-dict population-commands (list cmd))
+    (paced-dictionary-repopulate test-dict)
+    (let ((completions (paced-dictionary-completions test-dict "o" nil)))
+      (should (equal completions '("o"))))))
+
 (ert-deftest paced-completions-all-completions ()
   (let* ((paced--registered-dictionaries paced-test-default-registered-map)
          (paced-global-dict-enable-alist '((text-mode . "test-dict-case")))
diff --git a/paced.el b/paced.el
index 128a04a..4d2f4d4 100644
--- a/paced.el
+++ b/paced.el
@@ -693,7 +693,8 @@ case-handling in `paced-dictionary-process-word'."
               (if (paced-mixed-case-word-p completion)
                   completion
                 (concat (substring prefix 0 prefix-length)
-                        (substring-no-properties completion 
prefix-length)))))))))))
+                        (substring-no-properties completion prefix-length)))))
+          completions))))))
 
 (cl-defmethod paced-dictionary-completions ((dict paced-dictionary) prefix 
action &optional pred)
   "Get the completions for PREFIX in DICT.



reply via email to

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