window(wrap): fix when we shift to new line
Add a newline at the top of the loop instead of the bottom
This commit is contained in:
parent
465c01e403
commit
a9a0abf16b
1 changed files with 4 additions and 4 deletions
|
@ -296,6 +296,10 @@ pub fn print(self: Window, segments: []const Segment, opts: PrintOptions) !Print
|
||||||
col = 0;
|
col = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (col >= self.width) {
|
||||||
|
row += 1;
|
||||||
|
col = 0;
|
||||||
|
}
|
||||||
const w = self.gwidth(s);
|
const w = self.gwidth(s);
|
||||||
if (w == 0) continue;
|
if (w == 0) continue;
|
||||||
if (opts.commit) self.writeCell(col, row, .{
|
if (opts.commit) self.writeCell(col, row, .{
|
||||||
|
@ -307,10 +311,6 @@ pub fn print(self: Window, segments: []const Segment, opts: PrintOptions) !Print
|
||||||
.link = segment.link,
|
.link = segment.link,
|
||||||
});
|
});
|
||||||
col += w;
|
col += w;
|
||||||
if (col >= self.width) {
|
|
||||||
row += 1;
|
|
||||||
col = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else false;
|
} else false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue