https://bugs.kde.org/show_bug.cgi?id=525103

--- Comment #1 from [email protected] ---
LLM also thinks it found another bug. Given it solved the previous bug, I will
post it what it says and what it wants to fix, but I understand when this will
just be dropped. I do not get this code at all.

> EscapeSequenceUrlExtractor::clearBetween() is called from 
> Screen::clearImage() whenever a region of the screen is erased — an "erase in 
> line" during a redraw, a clear, a scroll-region clear — and its job is to 
> forget any stored OSC 8 hyperlink that lies inside the erased span. The bug 
> is a coordinate-space mismatch: clearImage() hands it offsets computed as row 
> * columns + column with row measured from the top of the visible screen, but 
> the hyperlinks were recorded in absolute coordinates that include the 
> scrollback (cursorY + histLines). clearBetween() compared the two directly. 
> While the scrollback is empty the two spaces coincide and it behaves, but 
> once anything has scrolled off the top the comparison is meaningless and it 
> removes the wrong entries — in practice discarding still-visible hyperlinks 
> after a redraw. The fix is to add histLines * columns to the incoming offsets 
> before comparing, which is exactly the conversion clearImage() already 
> performs for its own selection-overlap check.

it wants to add 6 lines to /src/EscapeSequenceUrlExtractor.cpp)

line 94
void EscapeSequenceUrlExtractor::clearBetween(int loca, int loce)
{
    // loca/loce come from Screen::clearImage() and are screen-relative, but
the
    // stored URL coordinates include the scrollback (see
appendUrlText_impl()).
    const int scrollbackOffset = _screen->getHistLines() *
_screen->getColumns();
    loca += scrollbackOffset;
    loce += scrollbackOffset;

    [and then the function as it is now)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to