[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36550: mouse-face overlay calculation error
From: |
Eli Zaretskii |
Subject: |
bug#36550: mouse-face overlay calculation error |
Date: |
Sat, 13 Jul 2019 09:15:35 +0300 |
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 13 Jul 2019 02:31:15 +0200
> Cc: "36550@debbugs.gnu.org" <36550@debbugs.gnu.org>
>
> (progn
> (let ((point (point)))
> (insert "foo\n")
> (let ((o (make-overlay point (point))))
> (overlay-put o 'mouse-face 'highlight)
> (insert "bar"))))
>
> This should make a mouse face that's displayed the entire "foo" line,
> but it extends to the first character of the next line.
>
> If you make it one character shorter, then the entire line isn't
> highlighted.
>
> And! If you say `face' instead of `mouse-face', then everything is
> highlighted correctly (i.e., just the entire "foo" line, and not the "b"
> on the next line).
Mouse-face isn't supposed to cover newlines, I think. Why do you need
that?
The "one character shorter" variant does what it's expected to do,
because mouse-face is not extended to EOL as with other faces.
Mouse-face is for showing the parts of text that are mouse-sensitive,
so it makes no sense to highlight portions of display that have no
text.
> So is there some basic fault in the code that calculates the length of
> the mouse highlighting? I don't really know where to start looking...
It's in the display code, and is quite complicated due to
bidirectional text use case. See mouse_face_from_buffer_pos and its
subroutine rows_from_pos_range.
- bug#36550: Small bug fix in recentf.el, Linus Källberg, 2019/07/08
- bug#36550: Small bug fix in recentf.el, Lars Ingebrigtsen, 2019/07/08
- Message not available
- bug#36550: Small bug fix in recentf.el, Lars Ingebrigtsen, 2019/07/09
- bug#36550: Small bug fix in recentf.el, Linus Källberg, 2019/07/11
- bug#36550: Small bug fix in recentf.el, Lars Ingebrigtsen, 2019/07/12
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/12
- bug#36550: mouse-face overlay calculation error,
Eli Zaretskii <=
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Eli Zaretskii, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Eli Zaretskii, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Eli Zaretskii, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Lars Ingebrigtsen, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Linus Källberg, 2019/07/13
- bug#36550: mouse-face overlay calculation error, Eli Zaretskii, 2019/07/13