[texworks] Query and feature request
Stefan Löffler
st.loeffler at gmail.com
Sun Apr 16 07:41:18 CEST 2023
Dear Philip,
On 15.04.23 11:44, Philip Taylor (Hellenic Institute) wrote:
>
> Using the most recent version of TeXworks, I have found an oddity in
> the search functionality of the preview window — if I search for
> (e.g.,) ω in a freshly-opened preview window, it finds the first
> occurrence thereof; thereafter, it finds the next occurrence, and then
> the next, and so on, and there appears no way to reset the start of
> search.
>
Yes, this is known and (somewhat) intentional, although the user
interface doesn't reflect the intention (yet). The idea is to merge the
"Find" and "Find Again" functionality, i.e., that there is only one
"Find" which can be hit repeatedly to cycle through all results.
One possible workaround to reset the search is to search for some other
(possibly long non-sensical) string in between as that naturally forces
the code to reset.
Interestingly, I don't think this behavior has changed recently. There
have been a few fixes here and there (e.g., to the search result
sequence), but the overall behavior has been the same for several years,
IIRC.
> My feature request is related. Would it be possible to make the found
> string in the preview window infinitely more visible than currently ?
> The found string appears to be briefly highlit with a pale shade of
> yellow, which repidly disappears long before I can spot it, especially
> at "fit-to-page" rendering; could it please be a fully-saturated shade
> of yellow which remains on-screen until I dismiss it in some way —
> e.g., a new search or whatever, or perhaps <escape> if I do not wish
> to perform a new search ?
Infinitely more visible might be (mathematically) difficult ;).
The pale shade of yellow comes from the fact that this is currently
implemented as a simple, semi-transparent overlay. I.e., it's not a
"normal" selection that changes fore- and background colors, but just a
rectangle drawn on top. The reason for this is that the code essentially
just gets an image (rendered by the poppler library) to work with, so
there is no way to change text or color properties (other than in a
pixel-by-pixel sense). Also, there can be a wide variety of color
combinations. Sure, most of it will be black on white, but some might be
red on blue or white on a patterned background or whatever.
So, long story short, if we were to make the highlight (much) less
transparent and you wouldn't see the text beneath it anymore. I think I
once experimented with inverting all colors, but that looked very
jarring. What could be possible would be an opaque border around the
search result, akin to what the hyperref packages does by default. And
the duration the highlight is shown should be made configurable.
HTH,
Stefan
More information about the texworks
mailing list.