Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paragraph moving logic to avoid stuck at line beginning with number #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static int is_new_para(void)
#endif
return 1;
}
if (!isletter(c))
if (!isletter(c) && !isnumber(c))
return 1;
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions estruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,19 @@
#define isletter(c) (('a' <= c && LASTLL >= c) || ('A' <= c && LASTUL >= c) || (128<=c && c<=167))
#define islower(c) (('a' <= c && LASTLL >= c))
#define isupper(c) (('A' <= c && LASTUL >= c))
#define isnumber(c) (('0' <= c && '9' >= c))

#else

#define isletter(c) isxletter((0xFF & (c)))
#define islower(c) isxlower((0xFF & (c)))
#define isupper(c) isxupper((0xFF & (c)))
#define isnumber(c) isxnumber((0xFF & (c)))

#define isxletter(c) (('a' <= c && LASTLL >= c) || ('A' <= c && LASTUL >= c) || (192<=c && c<=255))
#define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c))
#define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c))
#define isxnumber(c) (('0' <= c && '9' >= c))

#endif

Expand Down
2 changes: 1 addition & 1 deletion word.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ int inword(void)
if (c >= 'A' && c <= 'Z')
#endif
return TRUE;
if (c >= '0' && c <= '9')
if (isnumber(c))
return TRUE;
return FALSE;
}
Expand Down