[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] User-defined fringe tooltips (a request for review)
From: |
Vladimir Kazanov |
Subject: |
Re: [PATCH] User-defined fringe tooltips (a request for review) |
Date: |
Wed, 27 Mar 2024 12:48:04 +0000 |
Hi Eli,
> > 1. Record buffer position of the fringe display spec in struct it.
> > Then move it to glyph_row the same way user_fringe_bitmap_id's are
> > copied over.
>
> When you say "move it", what is "it" in this case?
I record the position of the :help-echo message in the buffer in the
iterator (struct it). This is ptrdiff_t
left_user_fringe_help_echo_pos. Then I copy this buffer position into
(struct glyph_row), next to where left_user_fringe_bitmap sits.
> > 2. In note_fringe_highlight it becomes easy to retrieve the fringe
> > display spec using a single call to get_char_property_and_overlay(),
> > no need to iterate over a line, or have the implementation detail leak
> > into text properties.
>
> Why do you need to retrieve the display spec in note_fringe_highlight?
Once I have the position of the help-echo string (saved in the
glyph_row), I still have to retrieve the :help-echo string. That's
what the code calling (get_char_property_and_overlay) does in the
(note_fringe_highlight). This gives me a list/vector/etc of display
specs. Somewhere within the specs there should be a fringe spec as
this is what was recorded by the iterator (struct it).
And the fringe spec contains the help-echo message I need to show in
the tooltip.
> > What I don't really understand is whether I should handle overlays
> > with after-string/before-string properties.
>
> Ideally, yes. Is there some complication there that would make those
> overlays special?
I am not sure I understand everything about overlays but for some
reason I can't get Qafter_string/Qbefore_string overlay properties
from the position saved in the glyph_row when the overlay is not
represented by any visual element in the row.
> > Should I just go through all overlays touching the spec position and
> > parse into the after-string/before-string as well?
>
> Not sure I understand the question, but maybe if you answer the ones
> above, I will understand, or this question will answer itself.
Hope it all makes sense now. I'll try to get things working for all
variants of fringe definition.
--
Regards,
Vladimir Kazanov
- Re: [PATCH] User-defined fringe tooltips (a request for review), Vladimir Kazanov, 2024/03/25
- Re: [PATCH] User-defined fringe tooltips (a request for review), Eli Zaretskii, 2024/03/25
- Re: [PATCH] User-defined fringe tooltips (a request for review), Vladimir Kazanov, 2024/03/26
- Re: [PATCH] User-defined fringe tooltips (a request for review), Vladimir Kazanov, 2024/03/27
- Re: [PATCH] User-defined fringe tooltips (a request for review), Po Lu, 2024/03/27
- Re: [PATCH] User-defined fringe tooltips (a request for review), Vladimir Kazanov, 2024/03/27
- Re: [PATCH] User-defined fringe tooltips (a request for review), Po Lu, 2024/03/27
- Re: [PATCH] User-defined fringe tooltips (a request for review), Eli Zaretskii, 2024/03/27
- Re: [PATCH] User-defined fringe tooltips (a request for review),
Vladimir Kazanov <=