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:
parent
961b88ffd5
commit
a53ef127ec
2 changed files with 17 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue