diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2011-01-17 03:12:07 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2011-01-17 03:12:07 +0000 |
commit | d4091f5270ba3a39a5223b8db12f9950d863fe3d (patch) | |
tree | 3e5131339a227bf371a392af198a0ea17706ec5e /usr.bin/mg/random.c | |
parent | bd01b017361308097f0e7cc0d5b6210ca4615a75 (diff) |
Add back-to-indentation. (M-m)
Move the dot to the first non-whitespace character on the current line.
from Henri Kemppainen . ok theo
Diffstat (limited to 'usr.bin/mg/random.c')
-rw-r--r-- | usr.bin/mg/random.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/mg/random.c b/usr.bin/mg/random.c index 8a34e495e75..a3c3893e4b5 100644 --- a/usr.bin/mg/random.c +++ b/usr.bin/mg/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.26 2008/09/15 16:13:35 kjell Exp $ */ +/* $OpenBSD: random.c,v 1.27 2011/01/17 03:12:06 kjell Exp $ */ /* This file is in the public domain. */ @@ -440,3 +440,16 @@ space_to_tabstop(int f, int n) return (linsert((n << 3) - (curwp->w_doto & 7), ' ')); } #endif /* NOTAB */ + +/* + * Move the dot to the first non-whitespace character of the current line. + */ +int +backtoindent(int f, int n) +{ + gotobol(FFRAND, 1); + while (curwp->w_doto < llength(curwp->w_dotp) && + (isspace(lgetc(curwp->w_dotp, curwp->w_doto)))) + ++curwp->w_doto; + return (TRUE); +} |