Extract function for easier testing
This commit is contained in:
parent
ebd7a2ae22
commit
46bd19ffd6
1 changed files with 10 additions and 7 deletions
|
@ -112,6 +112,14 @@ which doesn't accept at least one space will break."
|
||||||
(setq eshell-prompt-regexp
|
(setq eshell-prompt-regexp
|
||||||
(format "%c ?%s" first (substring eshell-prompt-regexp 1))))))
|
(format "%c ?%s" first (substring eshell-prompt-regexp 1))))))
|
||||||
|
|
||||||
|
(defun efs--propertized-text ()
|
||||||
|
"Return the propertized text to insert into the eshell bufffer."
|
||||||
|
(let ((face (efs--doc 'eshell-fringe-status-success
|
||||||
|
'eshell-fringe-status-failure))
|
||||||
|
(bitmap (efs--doc eshell-fringe-status-success-bitmap
|
||||||
|
eshell-fringe-status-failure-bitmap)))
|
||||||
|
(propertize " " 'display `((left-fringe ,bitmap ,face)))))
|
||||||
|
|
||||||
(defun efs--revert-prompt-regexp ()
|
(defun efs--revert-prompt-regexp ()
|
||||||
"The counterpart for `efs--extend-prompt-regexp', remove a space.
|
"The counterpart for `efs--extend-prompt-regexp', remove a space.
|
||||||
|
|
||||||
|
@ -132,13 +140,8 @@ window."
|
||||||
(when eshell-last-command-name
|
(when eshell-last-command-name
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(let ((face (if (zerop eshell-last-command-status)
|
(let ((inhibit-read-only t))
|
||||||
'eshell-fringe-status-success
|
(insert (efs--propertized-text))))))
|
||||||
'eshell-fringe-status-failure))
|
|
||||||
(inhibit-read-only t))
|
|
||||||
(insert
|
|
||||||
(propertize " " 'display
|
|
||||||
`((left-fringe efs--arrow-bitmap ,face))))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-minor-mode eshell-fringe-status-mode
|
(define-minor-mode eshell-fringe-status-mode
|
||||||
|
|
Loading…
Reference in a new issue