Skip to content

Commit

Permalink
Use 'exact in exit-function only when string ends with / (#2646)
Browse files Browse the repository at this point in the history
  • Loading branch information
thierryvolpiatto committed Mar 20, 2024
1 parent d74e182 commit eae4f5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions helm-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2648,16 +2648,16 @@ Can be used for `completion-in-region-function' by advicing it with an
result start point end base-size))
;; Allow running extra property `:exit-function' (Bug#2265,
;; Bug#2356). Function is called with 'exact if the return value of
;; `try-completion' is a string (possibly a directory Bug#2274 if the
;; string ends with /), otherwise it is always called with 'finished.
;; However it is still not clear what to use, the documentation on this
;; beeing really bad (bug#2646).
;; `try-completion' is a string ending with / (possibly a directory
;; Bug#2274), otherwise it is always called with 'finished. However it
;; is still not clear what to use, the documentation on this beeing
;; really bad (see bug#2646).
(when (and (stringp string) exit-fun)
(funcall exit-fun string
(helm-acase (try-completion initial-input collection predicate)
;; FIXME: Should I limit 'exact only for strings ending
;; with / ?
((guard (stringp it)) 'exact)
((guard (and (stringp it)
(string-match "/\\'" it)))
'exact)
(t 'finished))))
(remove-hook 'helm-before-action-hook 'helm-completion-in-region--selection)
(customize-set-variable 'helm-completion-style old--helm-completion-style)
Expand Down

0 comments on commit eae4f5a

Please sign in to comment.