[Top][All Lists]

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

bug#25751: Query replace lazy highlighting

From: Juri Linkov
Subject: bug#25751: Query replace lazy highlighting
Date: Thu, 16 Feb 2017 23:01:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu)

> When query-replacing and confirming, matches get unhighlighted, and then
> highlighted again, which is very distracting. E.g. open a file, M-% a ->
> a, y, other matches of a get unhighlighted then highlighted again.
> (setq lazy-highlight-initial-delay 0) (shouldn't it be default by the
> way, at least on graphical displays?) reduces the problem but does not
> eliminate it (it produces small flickers). There's
> lazy-highlight-cleanup, but that disables cleanup completely, which I
> don't want.
> Can't this be eliminated?

The reason why it works this way is because lazy-highlight is not yet
optimized to handle changes: it needs to dehighlight the replaced text,
and to add highlighting in the new replacing text after every replacement.
I see no simpler solution than to write a new function with a name like
‘isearch-lazy-highlight-update-in-region’ that given the region boundaries
of the last replacement will rehighlight matches in that region.

reply via email to

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