mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
terminal2: adjust down edges
This commit is contained in:
@ -485,6 +485,7 @@ test "Selection: adjust up" {
|
||||
}
|
||||
}
|
||||
|
||||
// X
|
||||
test "Selection: adjust down" {
|
||||
const testing = std.testing;
|
||||
var screen = try Screen.init(testing.allocator, 5, 10, 0);
|
||||
@ -520,6 +521,7 @@ test "Selection: adjust down" {
|
||||
}
|
||||
}
|
||||
|
||||
// X
|
||||
test "Selection: adjust down with not full screen" {
|
||||
const testing = std.testing;
|
||||
var screen = try Screen.init(testing.allocator, 5, 10, 0);
|
||||
|
@ -482,6 +482,35 @@ test "Selection: adjust down" {
|
||||
}
|
||||
}
|
||||
|
||||
test "Selection: adjust down with not full screen" {
|
||||
const testing = std.testing;
|
||||
var s = try Screen.init(testing.allocator, 5, 10, 0);
|
||||
defer s.deinit();
|
||||
try s.testWriteString("A\nB\nC");
|
||||
|
||||
// On the last line
|
||||
{
|
||||
var sel = try Selection.init(
|
||||
&s,
|
||||
s.pages.pin(.{ .screen = .{ .x = 4, .y = 1 } }).?,
|
||||
s.pages.pin(.{ .screen = .{ .x = 3, .y = 2 } }).?,
|
||||
false,
|
||||
);
|
||||
defer sel.deinit(&s);
|
||||
sel.adjust(&s, .down);
|
||||
|
||||
// Start line
|
||||
try testing.expectEqual(point.Point{ .screen = .{
|
||||
.x = 4,
|
||||
.y = 1,
|
||||
} }, s.pages.pointFromPin(.screen, sel.start.*).?);
|
||||
try testing.expectEqual(point.Point{ .screen = .{
|
||||
.x = 4,
|
||||
.y = 2,
|
||||
} }, s.pages.pointFromPin(.screen, sel.end.*).?);
|
||||
}
|
||||
}
|
||||
|
||||
test "Selection: order, standard" {
|
||||
const testing = std.testing;
|
||||
const alloc = testing.allocator;
|
||||
|
Reference in New Issue
Block a user