Skip to content

Commit b6db7f3

Browse files
committed
fix rendering bug in meow--render-indicator
function used to only read meow-insert-indicator. this commit adds an association list to map states to indicator faces. fixes #246
1 parent 72d6ff3 commit b6db7f3

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

CUSTOMIZATIONS.org

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,19 @@ Default:
214214
(beacon . "BEACON"))
215215
#+end_src
216216

217-
A list of mappings for how state is displayed in modeline indicator.
217+
A association list of state symbols to strings describing the state.
218+
** meow-indicator-face-alist
219+
Default:
220+
221+
#+begin_src emacs-lisp
222+
((normal . meow-normal-indicator)
223+
(motion . meow-motion-indicator)
224+
(keypad . meow-keypad-indicator)
225+
(insert . meow-insert-indicator)
226+
(beacon . meow-beacon-indicator))
227+
#+end_src
228+
229+
An association list of meow state symbols to indicator face symbols.
218230

219231
** meow-display-thing-help
220232

meow-util.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ Looks up the state in meow-replace-state-name-list"
161161
(defun meow--render-indicator ()
162162
"Renders a short indicator based on the current state."
163163
(when (bound-and-true-p meow-global-mode)
164-
(let ((state-name (meow--get-state-name (meow--current-state))))
164+
(let* ((state (meow--current-state))
165+
(state-name (meow--get-state-name state))
166+
(indicator-face (alist-get state meow-indicator-face-alist)))
165167
(if state-name
166168
(propertize
167169
(format " %s " state-name)
168-
'face 'meow-insert-indicator)
170+
'face indicator-face)
169171
""))))
170172

171173
(defun meow--update-indicator ()

meow-var.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ This will affect how selection is displayed."
6868
:type '(alist :key-type (symbol :tag "Meow state")
6969
:key-value (string :tag "Indicator")))
7070

71+
(defvar meow-indicator-face-alist
72+
'((normal . meow-normal-indicator)
73+
(motion . meow-motion-indicator)
74+
(keypad . meow-keypad-indicator)
75+
(insert . meow-insert-indicator)
76+
(beacon . meow-beacon-indicator))
77+
"Alist of meow states -> faces")
78+
7179
(defcustom meow-select-on-change t
7280
"Whether to activate region when exiting INSERT mode
7381
after `meow-change', `meow-change-char' and `meow-change-save'."

0 commit comments

Comments
 (0)