Skip to content

Commit

Permalink
[complete] Prioritize flex style if flex style is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Jun 2, 2024
1 parent 6646778 commit 1f16f75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cider-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))

Expand Down
2 changes: 1 addition & 1 deletion test/cider-completion-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1f16f75

Please sign in to comment.