minmo : minmo-use-ascii

This commit is contained in:
bth 2026-06-03 20:48:37 -07:00
commit 3d1918b060

View file

@ -36,13 +36,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; unified symbol set for git and disk status on tty and pts ;; unified symbol set for git and disk status on tty and pts
;; ;;
;; git disk ;; status u : a : git : disk
;; ---------------------------------------- ;; --------------------------------------------
;; unmodified : ◻ : shadow : shadow ;; unmodified : ◻ : . : nil : nil
;; modified : ◱ : warning : error ;; modified : ◱ : * : warning : error
;; ignored/readonly : ◳ : success : success ;; ignored/readonly : ◳ : _ : success : success
;; staged/orphan : ◰ : link : warning ;; staged/orphan : ◰ : + : link : warning
;; untracked/buffer : ◲ : error : link ;; untracked/buffer : ◲ : ! : error : link
;; quadrant semantics: ;; quadrant semantics:
;; ;;
@ -62,9 +62,14 @@
"Unified symbol set for git and disk status with unicode and ascii variants "Unified symbol set for git and disk status with unicode and ascii variants
and their respective faces.") and their respective faces.")
(defcustom minmo-use-ascii nil
"whether to use ascii symbols instead of unicode"
:type '(boolean))
(defun minmo--status-string-face (status fstype) (defun minmo--status-string-face (status fstype)
(let* ( (let* (
(encoding (if (string-prefix-p "xterm" (tty-type)) 'unicode 'ascii)) (encoding (if (or minmo-use-ascii (not (string-prefix-p "xterm" (tty-type))))
'ascii 'unicode))
(row (cdr (assoc status minmo-status-alist))) (row (cdr (assoc status minmo-status-alist)))
(str (cdr (assoc encoding (car row)))) (str (cdr (assoc encoding (car row))))
(face (cdr (assoc fstype (cdr row)))) (face (cdr (assoc fstype (cdr row))))