feat: add fast_scroll mode support to horizontal scrolling

Also, bump the basic scroll step to 5 columns like other editors.
This commit is contained in:
CJ van den Berg 2026-01-14 11:08:17 +01:00
parent 961b88ffd5
commit a53ef127ec
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 17 additions and 7 deletions

View file

@ -29,14 +29,16 @@ pub inline fn eql(self: Self, other: Self) bool {
return self.row == other.row and self.col == other.col and self.rows == other.rows and self.cols == other.cols;
}
pub fn move_left(self: *Self) !void {
if (self.col > 0) {
self.col -= 1;
pub fn move_left(self: *Self, n: usize) error{Stop}!void {
if (self.col > n) {
self.col -= n;
} else if (self.col > 0) {
self.col = 0;
} else return error.Stop;
}
pub fn move_right(self: *Self) !void {
self.col += 1;
pub fn move_right(self: *Self, n: usize) error{Stop}!void {
self.col += n;
}
pub fn move_up(self: *Self) !void {