From cce3749761fc036f196cb50319c591f5d1fa5625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Sat, 20 Jun 2020 16:56:29 -0300 Subject: Fix cursor jumping to bottom of screen on rseek --- jet.cpp | 2 +- point.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jet.cpp b/jet.cpp index f5a901f..894fc69 100644 --- a/jet.cpp +++ b/jet.cpp @@ -3,7 +3,7 @@ #include #include #include -#define PAGE_SIZE 16 +#define PAGE_SIZE 2 #include "page.cpp" #include "point.cpp" #include "buffer.cpp" diff --git a/point.cpp b/point.cpp index 235d93c..8f05a46 100644 --- a/point.cpp +++ b/point.cpp @@ -148,7 +148,7 @@ struct Point { uint64_t seek(uint8_t c, uint64_t limit) { uint64_t travel_distance = 0; while (!at_end() && next_byte() != c && travel_distance < limit) { - move_forward(); + (*this)++; travel_distance++; } return travel_distance; @@ -157,7 +157,7 @@ struct Point { uint64_t rseek(uint8_t c, uint64_t limit) { uint64_t travel_distance = 0; while (!at_start() && prev_byte() != c && travel_distance < limit) { - move_backward(); + (*this)--; travel_distance++; } return travel_distance; -- cgit v1.2.3