Compare commits

..

No commits in common. "3294ba546e1db8615af0ec3f4434ea7c07a50fc6" and "150287217404b66a177cb2a8c4819b08016f5fc4" have entirely different histories.

24
p11k.el
View File

@ -1,8 +1,8 @@
;;; p11k.el --- PowerLevel10k prompt for Eshell -*- lexical-binding: t; -*- ;;; p11k.el --- PowerLevel10k prompt for Eshell -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Miranda Marquez ;; Copyright (C) 2023 Mitchell Marquez
;; Author: Miranda Marquez <mirmarq428@gmail.com> ;; Author: Mitchell Marquez <dr.m.perseos@gmail.com>
;; Keywords: terminals, convenience, faces ;; Keywords: terminals, convenience, faces
;; Package-Requires: ((dash) (all-the-icons) (eshell-prompt-extras) (f) (shrink-path)) ;; Package-Requires: ((dash) (all-the-icons) (eshell-prompt-extras) (f) (shrink-path))
@ -242,15 +242,12 @@ Use 'window-width' to calculate the total final width."
it) nil))) it) nil)))
(branch (--> "git branch" (branch (--> "git branch"
(shell-command-to-string it) (shell-command-to-string it)
(split-string it) (split-string it "\n" 'omit-nulls search-whitespace-regexp)
(cadr it) (if it (progn
;; (split-string it "\n" 'omit-nulls search-whitespace-regexp) (--filter (string-match-p (rx bol "* " (+ word)) it) it)
;; (if it (progn (split-string (car it))
;; (--filter (string-match-p (rx bol "* " (+ word)) it) it) (cadr it))
;; (split-string (car it)) "")))
;; (cadr it))
;; "")
))
(modcount (--> status-alist (modcount (--> status-alist
(--map (car it) it) (--map (car it) it)
(--count (string-match-p "M" it) it) (--count (string-match-p "M" it) it)
@ -265,7 +262,7 @@ Use 'window-width' to calculate the total final width."
nil)))) nil))))
(p11k/spaced-concat (p11k/spaced-concat
(if (eq p11k/prompt-flow 'fluent) "on" "") (if (eq p11k/prompt-flow 'fluent) "on" "")
(if branch (propertize branch 'face 'p11k/green) "") (propertize branch 'face 'p11k/green)
(if modcount (propertize modcount 'face 'p11k/yellow) "") (if modcount (propertize modcount 'face 'p11k/yellow) "")
(if untracked (propertize untracked 'face 'p11k/blue) ""))) (if untracked (propertize untracked 'face 'p11k/blue) "")))
"")) ""))
@ -303,7 +300,6 @@ Use 'window-width' to calculate the total final width."
"Toggle the direction that the prompt points according to `p11k/get-modal-status'." "Toggle the direction that the prompt points according to `p11k/get-modal-status'."
(save-match-data (save-match-data
(save-mark-and-excursion (save-mark-and-excursion
(if (re-search-backward eshell-prompt-regexp nil 'no-error)
(let ((inhibit-read-only t) (let ((inhibit-read-only t)
(new-caret (new-caret
(p11k/caret-color-status (p11k/caret-color-status
@ -312,7 +308,7 @@ Use 'window-width' to calculate the total final width."
(re-search-backward eshell-prompt-regexp) (re-search-backward eshell-prompt-regexp)
(goto-char (point-at-bol)) (goto-char (point-at-bol))
(delete-forward-char 1) (delete-forward-char 1)
(insert new-caret))) (insert new-caret))
))) )))
(defun p11k/esh-transient-prompt () (defun p11k/esh-transient-prompt ()