mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-21 19:26:09 +03:00
terminal: maintain dirty bits when rotating rows on clone
This commit is contained in:
@ -473,6 +473,11 @@ pub fn clone(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to maintain the dirty bits from the original page so
|
||||||
|
// instead of setting a range we grab the dirty bit and then
|
||||||
|
// set it on the new page in the new location.
|
||||||
|
var dirty = page.data.dirtyBitSet();
|
||||||
|
|
||||||
// Kind of slow, we want to shift the rows up in the page up to
|
// Kind of slow, we want to shift the rows up in the page up to
|
||||||
// end and then resize down.
|
// end and then resize down.
|
||||||
const rows = page.data.rows.ptr(page.data.memory);
|
const rows = page.data.rows.ptr(page.data.memory);
|
||||||
@ -483,6 +488,7 @@ pub fn clone(
|
|||||||
const old_dst = dst.*;
|
const old_dst = dst.*;
|
||||||
dst.* = src.*;
|
dst.* = src.*;
|
||||||
src.* = old_dst;
|
src.* = old_dst;
|
||||||
|
dirty.setValue(i, dirty.isSet(i + chunk.start));
|
||||||
}
|
}
|
||||||
page.data.size.rows = @intCast(len);
|
page.data.size.rows = @intCast(len);
|
||||||
total_rows += len;
|
total_rows += len;
|
||||||
|
Reference in New Issue
Block a user