diff --git a/p11k.el b/p11k.el index 70a056c..bd6902a 100644 --- a/p11k.el +++ b/p11k.el @@ -310,12 +310,19 @@ Use 'window-width' to calculate the total final width." (p11k/caret-color-status eshell-last-command-status) " "))))) +(defun mir/last-line-p () + "Return t if the point is on the last line of current buffer." + (eq + (point-max) + (point-at-eol))) (defun p11k/modal-caret (&optional throwaway) "Toggle the direction that the prompt points according to `p11k/get-modal-status'." (save-match-data (save-mark-and-excursion + (goto-char (point-max)) (if (re-search-backward eshell-prompt-regexp nil 'no-error) (let ((inhibit-read-only t) + (delete-active-region nil) (new-caret (p11k/caret-color-status eshell-last-command-status)))