mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: match multiple lines for osc8
This commit is contained in:
@ -2825,10 +2825,7 @@ pub fn cursorPosCallback(
|
|||||||
if (try self.linkAtPos(pos)) |_| {
|
if (try self.linkAtPos(pos)) |_| {
|
||||||
self.renderer_state.mouse.point = pos_vp;
|
self.renderer_state.mouse.point = pos_vp;
|
||||||
self.mouse.over_link = true;
|
self.mouse.over_link = true;
|
||||||
// Mark the new link's row as dirty.
|
self.renderer_state.terminal.screen.dirty.hyperlink_hover = true;
|
||||||
if (self.renderer_state.terminal.screen.pages.pin(.{ .viewport = pos_vp })) |pin| {
|
|
||||||
pin.markDirty();
|
|
||||||
}
|
|
||||||
try self.rt_surface.setMouseShape(.pointer);
|
try self.rt_surface.setMouseShape(.pointer);
|
||||||
try self.queueRender();
|
try self.queueRender();
|
||||||
} else if (over_link) {
|
} else if (over_link) {
|
||||||
|
@ -2005,7 +2005,7 @@ fn rebuildCells(
|
|||||||
if (self.updateCell(
|
if (self.updateCell(
|
||||||
screen,
|
screen,
|
||||||
cell,
|
cell,
|
||||||
if (link_match_set.orderedContains(screen, cell))
|
if (link_match_set.contains(screen, cell))
|
||||||
.single
|
.single
|
||||||
else
|
else
|
||||||
null,
|
null,
|
||||||
|
@ -274,6 +274,21 @@ pub const MatchSet = struct {
|
|||||||
alloc.free(self.matches);
|
alloc.free(self.matches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Checks if the matchset contains the given pin. This is slower than
|
||||||
|
/// orderedContains but is stateless and more flexible since it doesn't
|
||||||
|
/// require the points to be in order.
|
||||||
|
pub fn contains(
|
||||||
|
self: *MatchSet,
|
||||||
|
screen: *const Screen,
|
||||||
|
pin: terminal.Pin,
|
||||||
|
) bool {
|
||||||
|
for (self.matches) |sel| {
|
||||||
|
if (sel.contains(screen, pin)) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// Checks if the matchset contains the given pt. The points must be
|
/// Checks if the matchset contains the given pt. The points must be
|
||||||
/// given in left-to-right top-to-bottom order. This is a stateful
|
/// given in left-to-right top-to-bottom order. This is a stateful
|
||||||
/// operation and giving a point out of order can cause invalid
|
/// operation and giving a point out of order can cause invalid
|
||||||
|
@ -72,6 +72,10 @@ pub const Dirty = packed struct {
|
|||||||
/// Set when the selection is set or unset, regardless of if the
|
/// Set when the selection is set or unset, regardless of if the
|
||||||
/// selection is changed or not.
|
/// selection is changed or not.
|
||||||
selection: bool = false,
|
selection: bool = false,
|
||||||
|
|
||||||
|
/// When an OSC8 hyperlink is hovered, we set the full screen as dirty
|
||||||
|
/// because links can span multiple lines.
|
||||||
|
hyperlink_hover: bool = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The cursor position.
|
/// The cursor position.
|
||||||
|
Reference in New Issue
Block a user