diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-02 16:07:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-02 16:07:57 -0700 |
commit | 34faa14e34c3eb2dfe3fd2cad02826f12f00ec5b (patch) | |
tree | 33e10f6aea81f131c4a225ebb7b14bf552806a9d | |
parent | d861ad1bd06f20f505c99314c8d9004d13cb6625 (diff) | |
download | uemacs-34faa14e34c3eb2dfe3fd2cad02826f12f00ec5b.tar.gz |
Try updated rule for "is new paragraph"
This makes non-alphabetic characters at the beginning be a mark of a
paragraph. That's probably bogus, but let's try how it works.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | basic.c | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -272,20 +272,24 @@ int backline(int f, int n) #if WORDPRO static int is_new_para(void) { - int c; + int i, len; - /* Empty line? Always a new paragraph */ - if (!llength(curwp->w_dotp)) - return 1; + len = llength(curwp->w_dotp); + for (i = 0; i < len; i++) { + int c = lgetc(curwp->w_dotp, i); + if (c == ' ' || c == TAB) { #if PKCODE - /* "Justification" only stops at empty lines */ - if (justflag == TRUE) - return 0; + if (justflag) + continue; #endif - - c = lgetc(curwp->w_dotp, curwp->w_doto); - return c == TAB || c == ' '; + return 1; + } + if (!isletter(c)) + return 1; + return 0; + } + return 1; } /* |