aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2022-11-23 16:18:55 +0200
committerEli Zaretskii2022-11-23 16:18:55 +0200
commit5568ac2db0fe2707676d9e4d1cfe027fba83767d (patch)
tree6bd58400360b789e288bc8b2036c6707c09f625a /src
parent43060910874f46579fa190d9b5534508e4ea058e (diff)
downloademacs-5568ac2db0fe2707676d9e4d1cfe027fba83767d.tar.gz
emacs-5568ac2db0fe2707676d9e4d1cfe027fba83767d.zip
Fix error signaled by mouse-highlight on mode line
* src/xdisp.c (note_mode_line_or_margin_highlight): Avoid signaling args-out-of-range errors when mode-line format uses min-width 'display' property. (Bug#59452)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b5f013ea6a1..5dcf21dc4ce 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -34576,8 +34576,11 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
34576 } 34576 }
34577#endif /* HAVE_WINDOW_SYSTEM */ 34577#endif /* HAVE_WINDOW_SYSTEM */
34578 34578
34579 /* CHARPOS can be beyond the last position of STRING due, e.g., to
34580 min-width 'display' property. Fix that, to let all the calls to
34581 get-text-property below do their thing. */
34579 if (STRINGP (string)) 34582 if (STRINGP (string))
34580 pos = make_fixnum (charpos); 34583 pos = make_fixnum (min (charpos, SCHARS (string) - 1));
34581 34584
34582 /* Set the help text and mouse pointer. If the mouse is on a part 34585 /* Set the help text and mouse pointer. If the mouse is on a part
34583 of the mode line without any text (e.g. past the right edge of 34586 of the mode line without any text (e.g. past the right edge of