Skip to content

Commit

Permalink
feat: Add reset selection option
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed May 29, 2024
1 parent f312aad commit 6a147b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion company-fuzzy.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
(const :tag "sublime-fuzzy" sublime-fuzzy))
:group 'company-fuzzy)

(defcustom company-fuzzy-reset-selection nil
"If non-nil, reset the selection to default."
:type 'boolean
:group 'company-fuzzy)

(defcustom company-fuzzy-prefix-on-top t
"Have the matching prefix on top."
:type 'boolean
Expand Down Expand Up @@ -88,7 +93,7 @@
:type 'string
:group 'company-fuzzy)

(defcustom company-fuzzy-passthrough-backends '()
(defcustom company-fuzzy-passthrough-backends nil
"List of backends that already are fuzzy, so no filtering of candidates is done."
:type 'list
:group 'company-fuzzy)
Expand Down Expand Up @@ -430,6 +435,8 @@ If optional argument FLIP is non-nil, reverse query and pattern order."
;; IMPORTANT: Since the command `candidates' will change by `company-mode',
;; we manually set the candidates here so we get can consistent result.
(setq candidates (company-fuzzy--ht-all-candidates))
(when company-fuzzy-reset-selection
(setq company-selection company-selection-default))
;; Don't score when it start fresh, e.g. completing a function name in Java
;; with the . (dot) symbol
(unless company-fuzzy--is-trigger-prefix-p
Expand Down

0 comments on commit 6a147b5

Please sign in to comment.