mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
terminal: dumpScreen handles wrap
This commit is contained in:
@ -1691,6 +1691,7 @@ pub fn dumpString(
|
|||||||
var iter = opts.tl.rowIterator(.right_down, opts.br);
|
var iter = opts.tl.rowIterator(.right_down, opts.br);
|
||||||
while (iter.next()) |row_offset| {
|
while (iter.next()) |row_offset| {
|
||||||
const rac = row_offset.rowAndCell();
|
const rac = row_offset.rowAndCell();
|
||||||
|
const row = rac.row;
|
||||||
const cells = cells: {
|
const cells = cells: {
|
||||||
const cells: [*]pagepkg.Cell = @ptrCast(rac.cell);
|
const cells: [*]pagepkg.Cell = @ptrCast(rac.cell);
|
||||||
break :cells cells[0..self.pages.cols];
|
break :cells cells[0..self.pages.cols];
|
||||||
@ -1705,8 +1706,12 @@ pub fn dumpString(
|
|||||||
blank_rows = 0;
|
blank_rows = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: handle wrap
|
if (!row.wrap or !opts.unwrap) {
|
||||||
blank_rows += 1;
|
// If we're not wrapped, we always add a newline.
|
||||||
|
// If we are wrapped, we only add a new line if we're unwrapping
|
||||||
|
// soft-wrapped lines.
|
||||||
|
blank_rows += 1;
|
||||||
|
}
|
||||||
|
|
||||||
var blank_cells: usize = 0;
|
var blank_cells: usize = 0;
|
||||||
for (cells) |*cell| {
|
for (cells) |*cell| {
|
||||||
|
Reference in New Issue
Block a user