]> git.mdlowis.com Git - projs/tide.git/commitdiff
cursor_end now causes the cursor to stay at the end of the line when moving up or...
authorMike Lowis <mike.lowis@gentex.com>
Thu, 7 Jan 2016 10:57:25 +0000 (10:57 +0000)
committerMike Lowis <mike.lowis@gentex.com>
Thu, 7 Jan 2016 10:57:25 +0000 (10:57 +0000)
source/main.c
source/util.h

index 8f86979570a86524b533b4c4471bdac8f1aa8e7f..353c010d41585296816108710b3e8cf3d5cda59d 100644 (file)
@@ -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;
 }
index d32bcef94e57025a4e4c10c7c0179a515c23195a..7da66d3fa667fcbb5453680da7de4b519a756432 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <errno.h>
+#include <limits.h>
 
 /* Useful Standard Functions */
 #include <signal.h>