From: Mike Lowis Date: Thu, 7 Jan 2016 10:57:25 +0000 (+0000) Subject: cursor_end now causes the cursor to stay at the end of the line when moving up or... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=3419afb33eea61994dbab4dc2554eef390411761;p=projs%2Ftide.git cursor_end now causes the cursor to stay at the end of the line when moving up or down the document as well --- diff --git a/source/main.c b/source/main.c index 8f86979..353c010 100644 --- a/source/main.c +++ b/source/main.c @@ -252,7 +252,8 @@ static void cursor_home(void) static void cursor_end(void) { - Curr.x = ((line_length() <= 1) ? 0 : visible_length()); - Loc.offset = (line_length() > Max.x) ? line_length()-1 - Max.x : Loc.offset; + Curr.x = INT_MAX; + if (line_length() > Max.x) + Loc.offset = line_length() - (Max.x/2); ScreenDirty = true; } diff --git a/source/util.h b/source/util.h index d32bcef..7da66d3 100644 --- a/source/util.h +++ b/source/util.h @@ -6,6 +6,7 @@ #include #include #include +#include /* Useful Standard Functions */ #include