From: Mike Lowis Date: Mon, 4 Jan 2016 14:45:35 +0000 (+0000) Subject: Fixed handling of blank lines with cursor X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5ccf7e569f39e0e4f0774a04cec486f6208f5ab3;p=projs%2Ftide.git Fixed handling of blank lines with cursor --- diff --git a/source/main.c b/source/main.c index 11a8ba2..0c02cfc 100644 --- a/source/main.c +++ b/source/main.c @@ -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); }