Merge pull request #1730 from mitchellh/dirty

renderer/metal: reset screen dirty flag properly, be more careful setting selection dirty flag
This commit is contained in:
Mitchell Hashimoto
2024-05-06 18:38:05 -07:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@ -932,6 +932,7 @@ pub fn updateFrame(
// success and reset while we hold the lock. This is much easier // success and reset while we hold the lock. This is much easier
// than coordinating row by row or as changes are persisted. // than coordinating row by row or as changes are persisted.
state.terminal.flags.dirty = .{}; state.terminal.flags.dirty = .{};
state.terminal.screen.dirty = .{};
{ {
var it = state.terminal.screen.pages.pageIterator( var it = state.terminal.screen.pages.pageIterator(
.right_down, .right_down,

View File

@ -1344,10 +1344,12 @@ pub fn select(self: *Screen, sel_: ?Selection) !void {
/// Same as select(null) but can't fail. /// Same as select(null) but can't fail.
pub fn clearSelection(self: *Screen) void { pub fn clearSelection(self: *Screen) void {
if (self.selection) |*sel| sel.deinit(self); if (self.selection) |*sel| {
self.selection = null; sel.deinit(self);
self.dirty.selection = true; self.dirty.selection = true;
} }
self.selection = null;
}
pub const SelectionString = struct { pub const SelectionString = struct {
/// The selection to convert to a string. /// The selection to convert to a string.