Fix bug in eshell-starship
This commit is contained in:
parent
19d559d626
commit
73530f887f
@ -99,6 +99,9 @@ FIELD should be one of the keys in `eshell-starship--modules-by'."
|
|||||||
"A list of (NAME IS-DIR MODULE).
|
"A list of (NAME IS-DIR MODULE).
|
||||||
These represent files that cannot be stored in `eshell-starship--module-by'.")
|
These represent files that cannot be stored in `eshell-starship--module-by'.")
|
||||||
|
|
||||||
|
(defvar-local eshell-starship--is-first-prompt t
|
||||||
|
"Non-nil if we have never printed a prompt in this buffer.")
|
||||||
|
|
||||||
|
|
||||||
;;; Module API
|
;;; Module API
|
||||||
(defvar eshell-starship-modules (make-hash-table :test 'equal)
|
(defvar eshell-starship-modules (make-hash-table :test 'equal)
|
||||||
@ -988,8 +991,11 @@ Return a hash table mapping module names to their output."
|
|||||||
(defun eshell-starship--render-prompt ()
|
(defun eshell-starship--render-prompt ()
|
||||||
"Actually produce the prompt."
|
"Actually produce the prompt."
|
||||||
(concat
|
(concat
|
||||||
(unless (<= (line-number-at-pos) 3)
|
(prog1
|
||||||
"\n")
|
(unless (or eshell-starship--is-first-prompt
|
||||||
|
(zerop (buffer-size)))
|
||||||
|
"\n")
|
||||||
|
(setq eshell-starship--is-first-prompt nil))
|
||||||
(let ((mods (eshell-starship--build-module-string)))
|
(let ((mods (eshell-starship--build-module-string)))
|
||||||
(add-face-text-property 0 (length mods) 'default t mods)
|
(add-face-text-property 0 (length mods) 'default t mods)
|
||||||
mods)))
|
mods)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user