Merge pull request #7 from jeffkreeftmeijer/eshell-bol-ignoring-prompt

Use eshell-bol-ignoring-prompt on Emacs 30
This commit is contained in:
Pavel Korytov 2024-04-09 12:32:39 +03:00 committed by GitHub
commit 1b71d4c180
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,10 +128,15 @@ include here. Some examples:
(defvar eshell-atuin--session-id nil
"Current atuin session ID.")
(defun eshell-atuin--bol-ignoring-prompt ()
(if (fboundp 'eshell-bol-ignoring-prompt)
(eshell-bol-ignoring-prompt nil)
(beginning-of-line)))
(defun eshell-atuin--get-input ()
"Get eshell input string on the current line."
(save-excursion
(beginning-of-line)
(eshell-atuin--bol-ignoring-prompt)
(when (looking-at-p eshell-prompt-regexp)
(substring-no-properties (eshell-get-old-input)))))