Skip to content

Commit

Permalink
Fix selectrum-insert-current-candidate error when history is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
clemera committed Aug 1, 2020
1 parent e3a9e08 commit 219cc2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ The format is based on [Keep a Changelog].
`completing-read-multiple` when `crm-separator` has a non default
value. Previously it would replace the separator with commas when
adding new candidates ([#140]).
* `selectrum-insert-current-candidate` now works from
`selectrum-select-from-history` and other commands which ignore
history by setting `minibuffer-history-variable` to `t`. Previously
an error would be thrown.

[#67]: https://github.com/raxod502/selectrum/issues/67
[#82]: https://github.com/raxod502/selectrum/issues/82
Expand Down
3 changes: 2 additions & 1 deletion selectrum.el
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,8 @@ list). A null or non-positive ARG inserts the candidate corresponding to
selectrum--refined-candidates))
(full (selectrum--get-full candidate)))
(insert full)
(add-to-history minibuffer-history-variable full)
(unless (eq t minibuffer-history-variable)
(add-to-history minibuffer-history-variable full))
(apply
#'run-hook-with-args
'selectrum-candidate-inserted-hook
Expand Down

0 comments on commit 219cc2c

Please sign in to comment.