]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: fix eglot--dumb-tryc for "only possible completion" case
authorJoão Távora <joaotavora@gmail.com>
Fri, 26 Jan 2024 23:18:55 +0000 (17:18 -0600)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jan 2024 20:06:59 +0000 (21:06 +0100)
* lisp/progmodes/eglot.el (eglot--dumb-tryc): Fix for "only possible
  completion" case.

(cherry picked from commit 972466dce268c5697f47a7f342b13dbf01f23a39)

lisp/progmodes/eglot.el

index 408370745737e374bdb0b0724873665bda3236d6..beba268f92341b77cb0fb18cc9f9665df81bdb9b 100644 (file)
@@ -3061,9 +3061,10 @@ for which LSP on-type-formatting should be requested."
 
 (defun eglot--dumb-allc (pat table pred _point) (funcall table pat pred t))
 (defun eglot--dumb-tryc (pat table pred point)
-  (if-let ((probe (funcall table pat pred nil)))
-      (cons probe (length probe))
-    (cons pat point)))
+  (let ((probe (funcall table pat pred nil)))
+    (cond ((eq probe t) t)
+          (probe (cons probe (length probe)))
+          (t (cons pat point)))))
 
 (add-to-list 'completion-category-defaults '(eglot-capf (styles eglot--dumb-flex)))
 (add-to-list 'completion-styles-alist '(eglot--dumb-flex eglot--dumb-tryc eglot--dumb-allc))