mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
renderer/metal: show selections
This commit is contained in:
@ -1694,6 +1694,7 @@ fn rebuildCells(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (self.updateCell(
|
if (self.updateCell(
|
||||||
|
screen,
|
||||||
cell,
|
cell,
|
||||||
color_palette,
|
color_palette,
|
||||||
shaper_cell,
|
shaper_cell,
|
||||||
@ -1760,6 +1761,7 @@ fn rebuildCells(
|
|||||||
|
|
||||||
fn updateCell(
|
fn updateCell(
|
||||||
self: *Metal,
|
self: *Metal,
|
||||||
|
screen: *const terminal.Screen,
|
||||||
cell_pin: terminal.Pin,
|
cell_pin: terminal.Pin,
|
||||||
palette: *const terminal.color.Palette,
|
palette: *const terminal.color.Palette,
|
||||||
shaper_cell: font.shape.Cell,
|
shaper_cell: font.shape.Cell,
|
||||||
@ -1780,18 +1782,10 @@ fn updateCell(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// True if this cell is selected
|
// True if this cell is selected
|
||||||
// TODO(perf): we can check in advance if selection is in
|
const selected: bool = if (screen.selection) |sel|
|
||||||
// our viewport at all and not run this on every point.
|
sel.contains(screen, cell_pin)
|
||||||
const selected = false;
|
else
|
||||||
// TODO(paged-terminal)
|
false;
|
||||||
// const selected: bool = if (screen.selection) |sel| selected: {
|
|
||||||
// const screen_point = (terminal.point.Viewport{
|
|
||||||
// .x = x,
|
|
||||||
// .y = y,
|
|
||||||
// }).toScreen(screen);
|
|
||||||
//
|
|
||||||
// break :selected sel.contains(screen_point);
|
|
||||||
// } else false;
|
|
||||||
|
|
||||||
const rac = cell_pin.rowAndCell();
|
const rac = cell_pin.rowAndCell();
|
||||||
const cell = rac.cell;
|
const cell = rac.cell;
|
||||||
|
Reference in New Issue
Block a user