Page up page down

This commit is contained in:
Krzosa Karol
2024-07-04 16:21:02 +02:00
parent 2f52c018cd
commit b48cffd880
2 changed files with 51 additions and 26 deletions

View File

@@ -609,15 +609,15 @@ int64_t MoveLeft(Buffer &buffer, int64_t pos) {
return pos;
}
int64_t MoveDown(Buffer &buffer, int64_t pos) {
int64_t MoveDown(Buffer &buffer, int64_t pos, int64_t count = 1) {
LineAndColumn info = FindLineAndColumn(buffer, pos);
int64_t new_pos = FindPos(buffer, info.line.number + 1, info.column);
int64_t new_pos = FindPos(buffer, info.line.number + count, info.column);
return new_pos;
}
int64_t MoveUp(Buffer &buffer, int64_t pos) {
int64_t MoveUp(Buffer &buffer, int64_t pos, int64_t count = 1) {
LineAndColumn info = FindLineAndColumn(buffer, pos);
int64_t new_pos = FindPos(buffer, info.line.number - 1, info.column);
int64_t new_pos = FindPos(buffer, info.line.number - count, info.column);
return new_pos;
}