mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
support set top/bottom margin with zero params
This commit is contained in:
@ -714,6 +714,11 @@ test "Terminal: setScrollingRegion" {
|
|||||||
t.setScrollingRegion(7, 3);
|
t.setScrollingRegion(7, 3);
|
||||||
try testing.expectEqual(@as(usize, 0), t.scrolling_region.top);
|
try testing.expectEqual(@as(usize, 0), t.scrolling_region.top);
|
||||||
try testing.expectEqual(@as(usize, t.rows - 1), t.scrolling_region.bottom);
|
try testing.expectEqual(@as(usize, t.rows - 1), t.scrolling_region.bottom);
|
||||||
|
|
||||||
|
// Scroll region with zero top and bottom
|
||||||
|
t.setScrollingRegion(0, 0);
|
||||||
|
try testing.expectEqual(@as(usize, 0), t.scrolling_region.top);
|
||||||
|
try testing.expectEqual(@as(usize, t.rows - 1), t.scrolling_region.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Terminal: deleteLines" {
|
test "Terminal: deleteLines" {
|
||||||
|
@ -327,6 +327,7 @@ pub fn Stream(comptime Handler: type) type {
|
|||||||
// DECSTBM - Set Top and Bottom Margins
|
// DECSTBM - Set Top and Bottom Margins
|
||||||
// TODO: test
|
// TODO: test
|
||||||
'r' => if (@hasDecl(T, "setTopAndBottomMargin")) switch (action.params.len) {
|
'r' => if (@hasDecl(T, "setTopAndBottomMargin")) switch (action.params.len) {
|
||||||
|
0 => try self.handler.setTopAndBottomMargin(0, 0),
|
||||||
1 => try self.handler.setTopAndBottomMargin(action.params[0], 0),
|
1 => try self.handler.setTopAndBottomMargin(action.params[0], 0),
|
||||||
2 => try self.handler.setTopAndBottomMargin(action.params[0], action.params[1]),
|
2 => try self.handler.setTopAndBottomMargin(action.params[0], action.params[1]),
|
||||||
else => log.warn("invalid DECSTBM command: {}", .{action}),
|
else => log.warn("invalid DECSTBM command: {}", .{action}),
|
||||||
|
Reference in New Issue
Block a user