Skip to content

Commit

Permalink
Merge pull request #7 from jeffkreeftmeijer/eshell-bol-ignoring-prompt
Browse files Browse the repository at this point in the history
Use eshell-bol-ignoring-prompt on Emacs 30
  • Loading branch information
SqrtMinusOne authored Apr 9, 2024
2 parents 3113b9a + 4e599d2 commit 1b71d4c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eshell-atuin.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))

Expand Down

0 comments on commit 1b71d4c

Please sign in to comment.