summaryrefslogtreecommitdiff
path: root/driver.f90
diff options
context:
space:
mode:
Diffstat (limited to 'driver.f90')
-rw-r--r--driver.f9015
1 files changed, 13 insertions, 2 deletions
diff --git a/driver.f90 b/driver.f90
index 8008e81..f6841ce 100644
--- a/driver.f90
+++ b/driver.f90
@@ -43,10 +43,21 @@ implicit none
E%cy = min(E%cy + 1, E%screenrows)
cursor_moved = .true.
case(KEY_LEFT)
- E%cx = max(E%cx - 1, 0)
+ E%cx = E%cx - 1
+ if(E%cx < 0) then
+ E%cx = 0
+ E%coloff = min(E%coloff + 1, 0)
+ end if
cursor_moved = .true.
case(KEY_RIGHT)
- E%cx = min(E%cx + 1, E%screencols)
+ E%cx = E%cx + 1
+
+ Print *, E%cx, E%cy, E%rowoff, E%coloff
+
+ if(E%cx > E%screencols) then
+ E%coloff = E%coloff - 1
+ E%cx = E%cx - 1
+ end if
cursor_moved = .true.
case(KEY_PGUP)
delta = -1*E%screenrows