Skip to content

Commit d430ab3

Browse files
alexander-yakushevbbatsov
authored andcommitted
[complete] Prioritize flex style if flex style is requested
1 parent 6646778 commit d430ab3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs fixed
1010

11+
- [#3696](https://github.com/clojure-emacs/cider/pull/3696): Don't eagerly complete a candidate if there are other candidates matching `flex` style.
12+
1113
## 1.14.0 (2024-05-30)
1214

1315
### New features

cider-completion.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Only affects the `cider' completion category.`"
297297
(unless found-styles
298298
(setq found-styles '(styles basic)))
299299
(unless (member 'flex found-styles)
300-
(setq found-styles (append found-styles '(flex))))
300+
(setq found-styles (apply #'list 'styles 'flex (cdr found-styles))))
301301
(add-to-list 'completion-category-overrides (apply #'list 'cider found-styles (when found-cycle
302302
(list found-cycle))))))
303303

test/cider-completion-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
(unwind-protect
3838
(progn
3939
(it "adds `flex' and `basic' as a fallback"
40-
(let ((expected-category-overrides '((cider (styles basic flex)))))
40+
(let ((expected-category-overrides '((cider (styles flex basic)))))
4141
(cider-enable-flex-completion)
4242
(expect (member 'flex (assq 'styles (assq 'cider completion-category-overrides)))
4343
:to-be-truthy)

0 commit comments

Comments
 (0)