Skip to content

Commit eea8399

Browse files
committed
Fix hyperlinks
1 parent 9e9db42 commit eea8399

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/cascadia/TerminalCore/Terminal.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ bool Terminal::ShouldSendAlternateScroll(const unsigned int uiButton,
477477
// - The position relative to the viewport
478478
std::wstring Terminal::GetHyperlinkAtViewportPosition(const til::point viewportPos)
479479
{
480-
return GetHyperlinkAtBufferPosition(_ConvertToBufferCell(viewportPos));
480+
return GetHyperlinkAtBufferPosition(_ConvertToBufferCell(viewportPos, false));
481481
}
482482

483483
std::wstring Terminal::GetHyperlinkAtBufferPosition(const til::point bufferPos)
@@ -501,12 +501,8 @@ std::wstring Terminal::GetHyperlinkAtBufferPosition(const til::point bufferPos)
501501
result = GetHyperlinkIntervalFromViewportPosition(viewportPos);
502502
if (result.has_value())
503503
{
504-
// GetPlainText and _ConvertToBufferCell work with inclusive coordinates, but interval's
505-
// stop point is (horizontally) exclusive, so let's just update it.
506-
result->stop.x--;
507-
508-
result->start = _ConvertToBufferCell(result->start);
509-
result->stop = _ConvertToBufferCell(result->stop);
504+
result->start = _ConvertToBufferCell(result->start, false);
505+
result->stop = _ConvertToBufferCell(result->stop, false);
510506
}
511507
}
512508
else
@@ -1465,7 +1461,6 @@ PointTree Terminal::_getPatterns(til::CoordType beg, til::CoordType end) const
14651461
// PointTree uses half-open ranges and viewport-relative coordinates.
14661462
range.start.y -= beg;
14671463
range.end.y -= beg;
1468-
range.end.x++;
14691464
intervals.push_back(PointTree::interval(range.start, range.end, 0));
14701465
} while (uregex_findNext(re.get(), &status));
14711466
}

0 commit comments

Comments
 (0)