mirror of https://github.com/djcb/mu.git
mu4e-main: fix off-by-one error in `mu4e~main-action-str'
For bookmarks, which specify the key combo instead of using the first character of the string had an off-by-one error in the mouse highlighting since it wasn't consuming that first letter.
This commit is contained in:
parent
5110b02349
commit
9f1e231824
|
@ -107,7 +107,14 @@ clicked."
|
|||
(define-key map (kbd "RET") func)
|
||||
(put-text-property 0 (length newstr) 'keymap map newstr)
|
||||
(put-text-property (string-match "\\[.+$" newstr)
|
||||
(- (length newstr) 1) 'mouse-face 'highlight newstr)
|
||||
;; only subtract one from length of newstr if we're
|
||||
;; actually consuming the first letter (e.g.
|
||||
;; `func-or-shortcut' is a function, meaning we put
|
||||
;; braces around the first letter of `str')
|
||||
(if (stringp func-or-shortcut)
|
||||
(length newstr)
|
||||
(- (length newstr) 1))
|
||||
'mouse-face 'highlight newstr)
|
||||
newstr))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue