Fix mthml submode lighting at end of buffer
* lisp/textmodes/mhtml-mode.el (mhtml--submode-lighter): Handle end of buffer correctly.
This commit is contained in:
parent
557e252aa2
commit
4c4ad80848
1 changed files with 6 additions and 1 deletions
|
@ -149,7 +149,12 @@ code();
|
||||||
|
|
||||||
(defun mhtml--submode-lighter ()
|
(defun mhtml--submode-lighter ()
|
||||||
"Mode-line lighter indicating the current submode."
|
"Mode-line lighter indicating the current submode."
|
||||||
(let ((submode (get-text-property (point) 'mhtml-submode)))
|
;; The end of the buffer has no text properties, so in this case
|
||||||
|
;; back up one character, if possible.
|
||||||
|
(let* ((where (if (and (eobp) (not (bobp)))
|
||||||
|
(1- (point))
|
||||||
|
(point)))
|
||||||
|
(submode (get-text-property where 'mhtml-submode)))
|
||||||
(if submode
|
(if submode
|
||||||
(mhtml--submode-name submode)
|
(mhtml--submode-name submode)
|
||||||
"")))
|
"")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue