]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed handling of blank lines with cursor
authorMike Lowis <mike.lowis@gentex.com>
Mon, 4 Jan 2016 14:45:35 +0000 (14:45 +0000)
committerMike Lowis <mike.lowis@gentex.com>
Mon, 4 Jan 2016 14:45:35 +0000 (14:45 +0000)
source/main.c

index 11a8ba22cda0e94248f02d34899d02a7174e27f3..0c02cfc081f2cfc6b383d2c87d28b1e88fe68d0e 100644 (file)
@@ -165,7 +165,9 @@ static void input(int ch)
             break;
     }
     /* Cap the column selection at the end of text on the current line */
-    if (Curr.x >= (Loc.line->length-1 - Loc.offset))
+    if (Loc.line->length <= 1)
+        Curr.x = 0;
+    else if (Curr.x >= (Loc.line->length-1 - Loc.offset))
         Curr.x = (Loc.line->length-2 - Loc.offset);
 }