bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when trun


From: Eli Zaretskii
Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect
Date: Fri, 29 Jul 2022 22:02:02 +0300

> Date: Fri, 29 Jul 2022 18:37:55 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: Lars Ingebrigtsen <larsi@gnus.org>, Eli Zaretskii <eliz@gnu.org>, 
>     56815@debbugs.gnu.org
> 
> > Indeed what is worth trying is to add pos-visible-in-window-group-p 
> > either to isearch-filter-predicate, or directly to 
> > isearch-lazy-highlight-search.
> 
> That wouldn't work alas.
> 
> The problem is how "visible" is defined here (by pos-visible-in-window-p). 
> With truncated lines, all buffer positions between window-start and 
> window-end are "visible", or IOW, all buffer positions on the left or 
> right of the actually visible line portion are "visible".

One could use posn-at-point instead.

> Moreover pos-visible-in-window-p is a slow function, so it would be 
> terribly slow to call it for each candidate position in a buffer with 
> (tens of) thousands of candidate positions.

I think posn-at-point is much faster, because it never actually looks
beyond the right edge of the window (it considers every position
beyond the rightmost shown one to be at the edge of the window, either
on the right-fringe, if fringes are shown, or at the last_visible_x
coordinate).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]