Fix issue with last element in path shortened
This commit is contained in:
		
							parent
							
								
									c40d13a0fd
								
							
						
					
					
						commit
						1914b7d0c2
					
				@ -24,8 +24,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
;;; Commentary:
 | 
					;;; Commentary:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; FIXME: All members of paths are shortened even if unnecessary when
 | 
					 | 
				
			||||||
;; displaying partitions.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;; Code:
 | 
					;;; Code:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -117,19 +115,20 @@ For public use, `PATH' should be a string representing a UNIX
 | 
				
			|||||||
path.  For internal use, `PATH' cna also be a list. If `PATH' is
 | 
					path.  For internal use, `PATH' cna also be a list. If `PATH' is
 | 
				
			||||||
neither of these, an error will be thrown by the function."
 | 
					neither of these, an error will be thrown by the function."
 | 
				
			||||||
  (cond
 | 
					  (cond
 | 
				
			||||||
   ((stringp path) (f-short
 | 
					   ((stringp path) (abbreviate-file-name
 | 
				
			||||||
                    (if abbr
 | 
					                    (if abbr
 | 
				
			||||||
                        (eshell-info-banner--abbr-path (f-split (eshell-info-banner--abbr-path path)))
 | 
					                        (eshell-info-banner--abbr-path (f-split (eshell-info-banner--abbr-path path)))
 | 
				
			||||||
                      path)))
 | 
					                      path)))
 | 
				
			||||||
   ((null path) "")
 | 
					   ((null path) "")
 | 
				
			||||||
   ((listp path)
 | 
					   ((listp path)
 | 
				
			||||||
    (f-join
 | 
					    (f-join (if (length= path 1)
 | 
				
			||||||
     (let* ((dir        (car path))
 | 
					                (car path)
 | 
				
			||||||
            (first-char (substring dir 0 1)))
 | 
					              (let* ((dir        (car path))
 | 
				
			||||||
       (if (equal "." first-char)
 | 
					                     (first-char (substring dir 0 1)))
 | 
				
			||||||
           (substring dir 0 2)
 | 
					                (if (string= "." first-char)
 | 
				
			||||||
         first-char))
 | 
					                    (substring dir 0 2)
 | 
				
			||||||
     (eshell-info-banner--abbr-path (cdr path))))
 | 
					                  first-char)))
 | 
				
			||||||
 | 
					            (eshell-info-banner--abbr-path (cdr path))))
 | 
				
			||||||
   (t (error "Invalid argument %s, neither stringp or listp" path))))
 | 
					   (t (error "Invalid argument %s, neither stringp or listp" path))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defun eshell-info-banner--get-mounted-partitions ()
 | 
					(defun eshell-info-banner--get-mounted-partitions ()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user