Merge pull request #6 from jeffkreeftmeijer/dont-require-match

Don't require history matches in completing-read
This commit is contained in:
Pavel Korytov 2024-04-05 12:17:49 +03:00 committed by GitHub
commit 3113b9a7ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -394,13 +394,13 @@ Be sure to have the correct `eshell-prompt-regexp' set up!"
(eshell-atuin--history-update) (eshell-atuin--history-update)
(let* ((commands (eshell-atuin--history-collection)) (let* ((commands (eshell-atuin--history-collection))
(input (eshell-atuin--get-input)) (input (eshell-atuin--get-input))
(compl (completing-read "History: " commands nil t input)) (compl (completing-read "History: " commands nil nil input))
(command (command
(alist-get 'command (alist-get 'command
(gethash compl eshell-atuin--history-cache-format-index)))) (gethash compl eshell-atuin--history-cache-format-index))))
(eshell-bol) (eshell-bol)
(delete-region (point) (line-end-position)) (delete-region (point) (line-end-position))
(insert command))) (insert (or command compl))))
(provide 'eshell-atuin) (provide 'eshell-atuin)
;;; eshell-atuin.el ends here ;;; eshell-atuin.el ends here