branch: externals/company
commit 38d62541107d8d1ebb3164bdd37eb89291d3907c
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
Fix regression from 8a0c52100e6f1d93
Closes #1413
---
company-dabbrev.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/company-dabbrev.el b/company-dabbrev.el
index 968b86cde6..63e138601d 100644
--- a/company-dabbrev.el
+++ b/company-dabbrev.el
@@ -176,24 +176,26 @@ This variable affects both `company-dabbrev' and
`company-dabbrev-code'."
(defun company-dabbrev--filter (prefix candidates)
(let* ((completion-ignore-case company-dabbrev-ignore-case)
(filtered (all-completions prefix candidates))
- (lp (length prefix)))
+ (lp (length prefix))
+ (downcase (if (eq company-dabbrev-downcase 'case-replace)
+ case-replace
+ company-dabbrev-downcase)))
+ (when downcase
+ (let ((ptr filtered))
+ (while ptr
+ (setcar ptr (downcase (car ptr)))
+ (setq ptr (cdr ptr)))))
(if (and (eq company-dabbrev-ignore-case 'keep-prefix)
(not (= lp 0)))
(company-substitute-prefix prefix filtered)
filtered)))
(defun company-dabbrev--fetch ()
- (let ((words (company-dabbrev--search (company-dabbrev--make-regexp)
- company-dabbrev-time-limit
- (pcase company-dabbrev-other-buffers
- (`t (list major-mode))
- (`all `all))))
- (downcase-p (if (eq company-dabbrev-downcase 'case-replace)
- case-replace
- company-dabbrev-downcase)))
- (if downcase-p
- (mapcar 'downcase words)
- words)))
+ (company-dabbrev--search (company-dabbrev--make-regexp)
+ company-dabbrev-time-limit
+ (pcase company-dabbrev-other-buffers
+ (`t (list major-mode))
+ (`all `all))))
;;;###autoload
(defun company-dabbrev (command &optional arg &rest _ignored)