Minor adjustments

This commit is contained in:
2025-12-11 23:17:29 +00:00
parent 239a11c7a0
commit 958974dc29
10 changed files with 34 additions and 31 deletions

View File

@@ -47,16 +47,13 @@ extreme end to CENTRE-SEGMENT."
(width (if (null (car margins))
win-width
(+ (car margins) win-width (cdr margins)))))
(- (floor (/ width 2)) (floor (/ centre-size 2)) other-size)))
(floor (- (/ width 2) (/ centre-size 2) other-size))))
(defun bml/--generate-padding (segment)
"Make padding string to separate center segment from SEGMENT."
(let* ((segment-size (length (format-mode-line segment)))
(padding-size (bml/--get-padding-size segment-size)))
(make-string (if (< padding-size bml/--minimum-padding)
bml/--minimum-padding
padding-size)
?\s)))
(make-string (min padding-size bml/--minimum-padding) ?\s)))
(defun bml/setup-mode-line ()
"Call this to setup the mode-line when:

View File

@@ -77,11 +77,10 @@ Uses tramp to figure out if we're in sudo mode or not. "
;; +eshell/open and +eshell/at-cwd
(defun +eshell/--current-instances ()
(cl-loop for buffer being the buffers
(cl-loop for buffer in (buffer-list)
if (with-current-buffer buffer
(eq major-mode 'eshell-mode))
collect
(cons (buffer-name buffer) buffer)))
collect (cons (buffer-name buffer) buffer)))
(defun +eshell/--choose-instance ()
(let* ((current-instances (+eshell/--current-instances))