From 3419afb33eea61994dbab4dc2554eef390411761 Mon Sep 17 00:00:00 2001 From: Mike Lowis Date: Thu, 7 Jan 2016 10:57:25 +0000 Subject: [PATCH] cursor_end now causes the cursor to stay at the end of the line when moving up or down the document as well --- source/main.c | 5 +++-- source/util.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.52.0