eshell: fix prompt face bleeding into command

This commit is contained in:
Henrik Lissner 2018-06-17 02:05:33 +02:00
parent 194bcf4c60
commit a6116c6547
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,17 +1,12 @@
;;; emacs/eshell/autoload/eshell.el -*- lexical-binding: t; -*- ;;; emacs/eshell/autoload/eshell.el -*- lexical-binding: t; -*-
;;;###autoload ;;;###autoload
(defface +eshell-prompt-pwd '((t :inherit eshell-prompt)) (defface +eshell-prompt-pwd '((t :inherit font-lock-constant-face))
"TODO" "TODO"
:group 'eshell) :group 'eshell)
;;;###autoload ;;;###autoload
(defface +eshell-prompt-git-branch '((t :inherit font-lock-function-name-face)) (defface +eshell-prompt-git-branch '((t :inherit font-lock-builtin-face))
"TODO"
:group 'eshell)
;;;###autoload
(defface +eshell-prompt-char '((t :inherit font-lock-constant-face))
"TODO" "TODO"
:group 'eshell) :group 'eshell)
@ -66,8 +61,9 @@
(concat (if (bobp) "" "\n") (concat (if (bobp) "" "\n")
(propertize (abbreviate-file-name (shrink-path-file (eshell/pwd))) (propertize (abbreviate-file-name (shrink-path-file (eshell/pwd)))
'face '+eshell-prompt-pwd) 'face '+eshell-prompt-pwd)
(propertize (+eshell--current-git-branch) 'face '+eshell-prompt-git-branch) (propertize (+eshell--current-git-branch)
(propertize " λ " 'face '+eshell-prompt-char))) 'face '+eshell-prompt-git-branch)
" λ "))
;; ;;
@ -231,8 +227,8 @@ delete."
(defun +eshell/switch (buffer) (defun +eshell/switch (buffer)
"Interactively switch to another eshell buffer." "Interactively switch to another eshell buffer."
(interactive (interactive
(let ((buffers (cl-remove-if-not (lambda (buf) (eq (buffer-local-value 'major-mode buf) 'eshell-mode)) (let ((buffers (doom-buffers-in-mode
(delete (current-buffer) (ring-elements +eshell-buffers))))) 'eshell-mode (delq (current-buffer) (ring-elements +eshell-buffers)))))
(if (not buffers) (if (not buffers)
(user-error "No eshell buffers are available") (user-error "No eshell buffers are available")
(list (completing-read (list (completing-read