From 3a56ea3fc1839e8d12910383620df794ba9d5d14 Mon Sep 17 00:00:00 2001 From: gunboy001 Date: Thu, 5 Dec 2019 17:44:59 +0100 Subject: [PATCH] home, end, pgup and pgdown keys now work correctly --- .sconsign.dblite | Bin 3124 -> 3124 bytes src/config.h | 1 + src/ste.c | 15 ++++++++++++--- src/ste.o | Bin 13872 -> 15016 bytes 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.sconsign.dblite b/.sconsign.dblite index 500006599782bda36867d782e2436c867b9e7f7a..24eec802c0ad11d40a846a681a5e4320e7fda280 100644 GIT binary patch delta 271 zcmdlYu|;CSH0HFE&o<6{#0a7{*D+}@8Rr_mjLl&6X3F3WRj@QMGczzYNlH$#OtmyJ zH8U|bNi{G@Oi4=u0`pYM!l(>h-xXGqZ?d!+zcoVWGfFm0O)y7@e-Dzg#H8KEr6#hK}ailGX|mdWO3 z#)-z3mPW>=#>SROX%h zI3*>~Jjui&F*U^~%_Jo;(WEdcgV)!Qa!rCO#X11Uoz zi!>ASM1!;xW79+flcd6QpuS4$$rD+11rho(AflVkv#K&1bzFJ`HZGJUxi~YuP%%^? zH7(i1A~n%C#WdB>GR?xmz{JQH=pf5v14DC*G|RNjYMlCv2)DH GFaiM2aaC0S diff --git a/src/config.h b/src/config.h index 4c645ad..6d912aa 100644 --- a/src/config.h +++ b/src/config.h @@ -3,5 +3,6 @@ #define TABSIZE 4 // Tab size as used in render #define MAX_LINE 1024 // maximum line length on screen +#define PGK_DELTA 15 #endif \ No newline at end of file diff --git a/src/ste.c b/src/ste.c index 984bf6e..0e48479 100644 --- a/src/ste.c +++ b/src/ste.c @@ -178,11 +178,19 @@ int main (int argc, char *argv[]) break; case (KEY_END): - t.cur.y = rows.rownum - 1; + t.cur.x = rows.rw[t.cur.y].size; break; case (KEY_HOME): - t.cur.y = 0; + t.cur.x = 0; + break; + + case (KEY_NPAGE): + t.cur.y += PGK_DELTA; + break; + + case (KEY_PPAGE): + t.cur.y -= PGK_DELTA; break; case (CTRL('f')): @@ -489,7 +497,8 @@ void curUpdateRender () */ /* Adjust x and y if they are out of bounds */ - if (t.cur.y < 0 || t.cur.y >= rows.rownum) t.cur.y = 0; + if (t.cur.y < 0) t.cur.y = 0; + if (t.cur.y >= rows.rownum) t.cur.y = rows.rownum - 1; if (t.cur.x < 0) t.cur.x = 0; if (t.cur.y >= t.cur.off_y && t.cur.y < t.cur.off_y + t.dim.y) { diff --git a/src/ste.o b/src/ste.o index 4ed4075115b26c8cd6dfde04ba8521ddea2d56c1..5647054d420415a14d2a928d3725e8952de5267e 100644 GIT binary patch literal 15016 zcmd6udw5jUwZQjb0s+LF1VQkkGGb8D+Q=yHZbgwzF4awGz((oBbZ_T#B-TY;` zmx!Aap#wa}I{w<|`lcEdWAm$<@G;sPY4X=XA)6fcPpl3^!GATe>K1{Ptg5VJtv8^|M*jJuXtWVBVYaZospbYhTT;JnT_h%rTQ^%j ztZ+}+DIPCtm9=u!3ioW+FetVYpUkSUlX;V;;DZ|~o)Sp&fCREqoIlyATr?AB4Rhz5 zk&IO&HxC~mHfub z-xUVk9y@V5>jdni164cHTMAE1P(5TPJ~o^S&HbT^vvWo|U(C7C`D>-@(GySD$xX%M zr4G@{;(?3@3Of6T0H?GlaEd>5<$-s(!lyB8fm2;W6b&5ZI&x#lP7Z}K#$$1I1Y;qy z%g!^q%7$5qZX=XhW`u-*mB<(exhRT<+zat$rOL7$>CGiiqhDRGy!`UZwY%N4`+B0s zu-$IkeEgu@ef-MA*CV!MT;82RS4DEk@LKb;bY~k>lf7jYapjew@4#*%J;cr#tW5E4 zuu6K|u}}#{aitg_%k2~g*7A@j;f=rbw%Y#qi&)wnS+jjjKFo-&MZ?UloAXk(A-oaQ za;6f;4Hy_Z>p|8!fDHpxA;#SFGuXfo^tIauP3v8dDl>TV&W+e|Oejf}8;PDFE^mo@ zsN{&qagT(pj`YS+IZJ_blKUR)*)k$ko)ywo^7|dx0aDrIW!U5-k6>!l^kA>KYaw)O z@Q|4*hr8QX@?R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