mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
Add adjust_selection
actions for beginning_of_line
and end_of_line
This commit is contained in:
@ -3471,6 +3471,8 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
|||||||
.page_down => .page_down,
|
.page_down => .page_down,
|
||||||
.home => .home,
|
.home => .home,
|
||||||
.end => .end,
|
.end => .end,
|
||||||
|
.beginning_of_line => .beginning_of_line,
|
||||||
|
.end_of_line => .end_of_line,
|
||||||
});
|
});
|
||||||
|
|
||||||
// If the selection endpoint is outside of the current viewpoint,
|
// If the selection endpoint is outside of the current viewpoint,
|
||||||
|
@ -304,6 +304,8 @@ pub const Action = union(enum) {
|
|||||||
page_down,
|
page_down,
|
||||||
home,
|
home,
|
||||||
end,
|
end,
|
||||||
|
beginning_of_line,
|
||||||
|
end_of_line,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const SplitDirection = enum {
|
pub const SplitDirection = enum {
|
||||||
|
@ -344,6 +344,8 @@ pub const Adjustment = enum {
|
|||||||
end,
|
end,
|
||||||
page_up,
|
page_up,
|
||||||
page_down,
|
page_down,
|
||||||
|
beginning_of_line,
|
||||||
|
end_of_line,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Adjust the selection by some given adjustment. An adjustment allows
|
/// Adjust the selection by some given adjustment. An adjustment allows
|
||||||
@ -362,7 +364,7 @@ pub fn adjust(
|
|||||||
.up => if (end_pin.up(1)) |new_end| {
|
.up => if (end_pin.up(1)) |new_end| {
|
||||||
end_pin.* = new_end;
|
end_pin.* = new_end;
|
||||||
} else {
|
} else {
|
||||||
end_pin.x = 0;
|
self.adjust(s, .beginning_of_line);
|
||||||
},
|
},
|
||||||
|
|
||||||
.down => {
|
.down => {
|
||||||
@ -377,7 +379,7 @@ pub fn adjust(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If we're at the bottom, just go to the end of the line
|
// If we're at the bottom, just go to the end of the line
|
||||||
end_pin.x = end_pin.page.data.size.cols - 1;
|
self.adjust(s, .end_of_line);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -440,6 +442,10 @@ pub fn adjust(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
.beginning_of_line => end_pin.x = 0,
|
||||||
|
|
||||||
|
.end_of_line => end_pin.x = end_pin.page.data.size.cols - 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user