Skip to content

Commit 34faa14

Browse files
committed
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 <[email protected]>
1 parent d861ad1 commit 34faa14

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

basic.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,20 +272,24 @@ int backline(int f, int n)
272272
#if WORDPRO
273273
static int is_new_para(void)
274274
{
275-
int c;
275+
int i, len;
276276

277-
/* Empty line? Always a new paragraph */
278-
if (!llength(curwp->w_dotp))
279-
return 1;
277+
len = llength(curwp->w_dotp);
280278

279+
for (i = 0; i < len; i++) {
280+
int c = lgetc(curwp->w_dotp, i);
281+
if (c == ' ' || c == TAB) {
281282
#if PKCODE
282-
/* "Justification" only stops at empty lines */
283-
if (justflag == TRUE)
284-
return 0;
283+
if (justflag)
284+
continue;
285285
#endif
286-
287-
c = lgetc(curwp->w_dotp, curwp->w_doto);
288-
return c == TAB || c == ' ';
286+
return 1;
287+
}
288+
if (!isletter(c))
289+
return 1;
290+
return 0;
291+
}
292+
return 1;
289293
}
290294

291295
/*

0 commit comments

Comments
 (0)