]> git.mdlowis.com Git - projs/tide.git/commitdiff
+cursorEnd
authora bellenir <a@bellenir.com>
Mon, 4 Jan 2016 21:07:59 +0000 (16:07 -0500)
committera bellenir <a@bellenir.com>
Mon, 4 Jan 2016 21:07:59 +0000 (16:07 -0500)
source/main.c

index 260f5365466b176179d1eec7e0af8e6c963d48d1..b5e73694ff244fc58e5779a73c2b6ab55bbcb0d5 100644 (file)
@@ -50,6 +50,7 @@ static void cursorDown(void);
 static void cursorUp(void);
 static void cursorRight(void);
 static void cursorHome(void);
+static void cursorEnd(void);
 
 /* Main Routine
  *****************************************************************************/
@@ -164,6 +165,11 @@ static void input(int ch)
         case '0':
             cursorHome();
             break;
+
+        case KEY_END:
+        case '$':
+            cursorEnd();
+            break;
     }
     /* Cap the column selection at the end of text on the current line */
     if (Loc.line->length <= 1)
@@ -232,3 +238,12 @@ static void cursorHome()
     }
 }
 
+static void cursorEnd()
+{
+    if (Loc.line->length <= 1)
+        Curr.x = 0;
+    else
+        Curr.x = (Loc.line->length-2 - Loc.offset);
+    ScreenDirty = true;
+}
+