emacs-diffs
[Top][All Lists]
Advanced

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

master 972466dce26: Eglot: fix eglot--dumb-tryc for "only possible compl


From: João Távora
Subject: master 972466dce26: Eglot: fix eglot--dumb-tryc for "only possible completion" case
Date: Fri, 26 Jan 2024 19:05:38 -0500 (EST)

branch: master
commit 972466dce268c5697f47a7f342b13dbf01f23a39
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: fix eglot--dumb-tryc for "only possible completion" case
    
    * lisp/progmodes/eglot.el (eglot--dumb-tryc): Fix for "only possible
      completion" case.
---
 lisp/progmodes/eglot.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 40837074573..beba268f923 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -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))



reply via email to

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