Fix bug in eshell-starship.el
This commit is contained in:
		@ -492,12 +492,17 @@ For example, a revert.  If there is no current operation, return nil."
 | 
			
		||||
  (prog1
 | 
			
		||||
      (and eshell-starship--last-start-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--last-start-time)))
 | 
			
		||||
    (setq eshell-starship--last-start-time nil
 | 
			
		||||
          eshell-starship--last-end-time nil)))
 | 
			
		||||
 | 
			
		||||
(eshell-starship-defmodule cmd-time
 | 
			
		||||
  :predicate 'always
 | 
			
		||||
  :prefix "took "
 | 
			
		||||
  :color "gold1"
 | 
			
		||||
  :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)))
 | 
			
		||||
  :postcmd-action (lambda ()
 | 
			
		||||
                    (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
 | 
			
		||||
  :doc "The amount of time it took the last command to execute.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user