branch: externals/eglot
commit 16bbf8564f52312f81bef56f57d46cb08d6df291
Author: Jürgen Hötzel <[email protected]>
Commit: GitHub <[email protected]>

    Fix #582: flex completion style is not available on Emacs < 27
    
    * eglot.el (eglot--managed-mode): check if flex style available
    
    Copyright-paperwork-exempt: yes
---
 eglot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index c7f70ea..9267a13 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1362,7 +1362,8 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
     (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend 
t))
     (eglot--setq-saving company-backends '(company-capf))
     (eglot--setq-saving company-tooltip-align-annotations t)
-    (eglot--setq-saving completion-styles '(flex basic))
+    (when (assoc 'flex completion-styles-alist)
+      (eglot--setq-saving completion-styles '(flex basic)))
     (unless (eglot--stay-out-of-p 'imenu)
       (add-function :before-until (local 'imenu-create-index-function)
                     #'eglot-imenu))

Reply via email to