I have found this feature useful in other text editors. Maybe you will too?


--- mg.1.orig   Sun Sep 12 20:23:21 2010
+++ mg.1        Sun Sep 12 20:24:36 2010
@@ -320,7 +320,8 @@ Move cursor backwards by the specified number of words
 .It beginning-of-buffer
 Move cursor to the top of the buffer.
 .It beginning-of-line
-Move cursor to the beginning of the line.
+Move cursor to the beginning of the line. Calling this function again moves
+the cursor to the first non-whitespace character of the line.
 .It blink-and-insert
 Self-insert a character, then search backwards and blink its
 matching delimeter.


--- basic.c.orig        Sun Sep 12 20:01:41 2010
+++ basic.c     Sun Sep 12 20:18:56 2010
@@ -22,7 +22,21 @@
 int
 gotobol(int f, int n)
 {
-       curwp->w_doto = 0;
+       if (0 != curwp->w_doto)
+               curwp->w_doto = 0;
+       else {
+               char * ln = curwp->w_dotp->l_text;
+               int i = 0;
+
+               if (ln)
+                       while (*ln && isspace(*ln)) {
+                               i++;
+                               ln++;
+                       }
+
+               curwp->w_doto = i;
+       }
+
        return (TRUE);
 }


-- 
http://noncombatant.org/

Reply via email to