mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
terminal: insertLines resets wrap
This commit is contained in:
@ -1546,6 +1546,7 @@ pub fn insertLines(self: *Terminal, count: usize) !void {
|
|||||||
|
|
||||||
// Move the cursor to the left margin
|
// Move the cursor to the left margin
|
||||||
self.screen.cursor.x = 0;
|
self.screen.cursor.x = 0;
|
||||||
|
self.screen.cursor.pending_wrap = false;
|
||||||
|
|
||||||
// Remaining rows from our cursor
|
// Remaining rows from our cursor
|
||||||
const rem = self.scrolling_region.bottom - self.screen.cursor.y + 1;
|
const rem = self.scrolling_region.bottom - self.screen.cursor.y + 1;
|
||||||
@ -2495,6 +2496,24 @@ test "Terminal: insertLines more than remaining" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "Terminal: insertLines resets wrap" {
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
var t = try init(alloc, 5, 5);
|
||||||
|
defer t.deinit(alloc);
|
||||||
|
|
||||||
|
for ("ABCDE") |c| try t.print(c);
|
||||||
|
try testing.expect(t.screen.cursor.pending_wrap);
|
||||||
|
try t.insertLines(1);
|
||||||
|
try testing.expect(!t.screen.cursor.pending_wrap);
|
||||||
|
try t.print('B');
|
||||||
|
|
||||||
|
{
|
||||||
|
var str = try t.plainString(testing.allocator);
|
||||||
|
defer testing.allocator.free(str);
|
||||||
|
try testing.expectEqualStrings("B\nABCDE", str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Terminal: reverseIndex" {
|
test "Terminal: reverseIndex" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 2, 5);
|
var t = try init(alloc, 2, 5);
|
||||||
|
Reference in New Issue
Block a user