From: a bellenir Date: Mon, 4 Jan 2016 21:07:59 +0000 (-0500) Subject: +cursorEnd X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=b650098e733eeace503370e7e84e2ad08c1ec4a9;p=projs%2Ftide.git +cursorEnd --- diff --git a/source/main.c b/source/main.c index 260f536..b5e7369 100644 --- a/source/main.c +++ b/source/main.c @@ -50,6 +50,7 @@ static void cursorDown(void); static void cursorUp(void); static void cursorRight(void); static void cursorHome(void); +static void cursorEnd(void); /* Main Routine *****************************************************************************/ @@ -164,6 +165,11 @@ static void input(int ch) case '0': cursorHome(); break; + + case KEY_END: + case '$': + cursorEnd(); + break; } /* Cap the column selection at the end of text on the current line */ if (Loc.line->length <= 1) @@ -232,3 +238,12 @@ static void cursorHome() } } +static void cursorEnd() +{ + if (Loc.line->length <= 1) + Curr.x = 0; + else + Curr.x = (Loc.line->length-2 - Loc.offset); + ScreenDirty = true; +} +