From 1f16f751232491e462408994a2c4d240314af1a3 Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Sun, 2 Jun 2024 10:27:01 +0300 Subject: [PATCH] [complete] Prioritize flex style if flex style is requested --- CHANGELOG.md | 2 ++ cider-completion.el | 2 +- test/cider-completion-tests.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acce10fb3..54ef88a46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs fixed +- [#3696](https://github.com/clojure-emacs/cider/pull/3696): Don't eagerly complete a candidate if there are other candidates matching `flex` style. + ## 1.14.0 (2024-05-30) ### New features diff --git a/cider-completion.el b/cider-completion.el index bd23c3859..a2a91ae57 100644 --- a/cider-completion.el +++ b/cider-completion.el @@ -297,7 +297,7 @@ Only affects the `cider' completion category.`" (unless found-styles (setq found-styles '(styles basic))) (unless (member 'flex found-styles) - (setq found-styles (append found-styles '(flex)))) + (setq found-styles (apply #'list 'styles 'flex (cdr found-styles)))) (add-to-list 'completion-category-overrides (apply #'list 'cider found-styles (when found-cycle (list found-cycle)))))) diff --git a/test/cider-completion-tests.el b/test/cider-completion-tests.el index e80f4253a..a8f58f798 100644 --- a/test/cider-completion-tests.el +++ b/test/cider-completion-tests.el @@ -37,7 +37,7 @@ (unwind-protect (progn (it "adds `flex' and `basic' as a fallback" - (let ((expected-category-overrides '((cider (styles basic flex))))) + (let ((expected-category-overrides '((cider (styles flex basic))))) (cider-enable-flex-completion) (expect (member 'flex (assq 'styles (assq 'cider completion-category-overrides))) :to-be-truthy)