Fix bug in eshell-starship.el
This commit is contained in:
parent
09914fc3a9
commit
dc789627c0
@ -492,12 +492,17 @@ For example, a revert. If there is no current operation, return nil."
|
|||||||
(prog1
|
(prog1
|
||||||
(and eshell-starship--last-start-time
|
(and eshell-starship--last-start-time
|
||||||
eshell-starship--last-end-time
|
eshell-starship--last-end-time
|
||||||
|
;; this must be here (not in a predicate) to ensure these values get
|
||||||
|
;; cleared
|
||||||
|
(<= 3 (- eshell-starship--last-end-time
|
||||||
|
eshell-starship--last-start-time))
|
||||||
(eshell-starship-format-span (- eshell-starship--last-end-time
|
(eshell-starship-format-span (- eshell-starship--last-end-time
|
||||||
eshell-starship--last-start-time)))
|
eshell-starship--last-start-time)))
|
||||||
(setq eshell-starship--last-start-time nil
|
(setq eshell-starship--last-start-time nil
|
||||||
eshell-starship--last-end-time nil)))
|
eshell-starship--last-end-time nil)))
|
||||||
|
|
||||||
(eshell-starship-defmodule cmd-time
|
(eshell-starship-defmodule cmd-time
|
||||||
|
:predicate 'always
|
||||||
:prefix "took "
|
:prefix "took "
|
||||||
:color "gold1"
|
:color "gold1"
|
||||||
:reload-on 'always
|
:reload-on 'always
|
||||||
@ -505,11 +510,6 @@ For example, a revert. If there is no current operation, return nil."
|
|||||||
(setq eshell-starship--last-start-time (float-time)))
|
(setq eshell-starship--last-start-time (float-time)))
|
||||||
:postcmd-action (lambda ()
|
:postcmd-action (lambda ()
|
||||||
(setq eshell-starship--last-end-time (float-time)))
|
(setq eshell-starship--last-end-time (float-time)))
|
||||||
:predicate (lambda ()
|
|
||||||
(and eshell-starship--last-start-time
|
|
||||||
eshell-starship--last-end-time
|
|
||||||
(<= 3 (- eshell-starship--last-end-time
|
|
||||||
eshell-starship--last-start-time))))
|
|
||||||
:action 'eshell-starship--last-command-time
|
:action 'eshell-starship--last-command-time
|
||||||
:doc "The amount of time it took the last command to execute.")
|
:doc "The amount of time it took the last command to execute.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user