summaryrefslogtreecommitdiff
path: root/src/spreed.c
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2026-04-24 14:00:20 -0400
committerJonathan Bradley <jcb@pikum.xyz>2026-04-24 14:00:20 -0400
commit9d64e3e3cbe2771a5c2787cdcad8f9372e6b3040 (patch)
tree540faac33f3d423267961a441aa12a30636fdc3f /src/spreed.c
parenta20572b4b15a63e3a2df3c59cf3f59409e0c4718 (diff)
pad cooldown: lax punctuation word position
Diffstat (limited to 'src/spreed.c')
-rwxr-xr-xsrc/spreed.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/spreed.c b/src/spreed.c
index 406c288..0ec2971 100755
--- a/src/spreed.c
+++ b/src/spreed.c
@@ -172,8 +172,15 @@ END_OF_WORD:
fflush(stdout);
- if (word[iword-1] == L'.') {
- cooldown += wpm_ns;
+ while (iword > 0) {
+ if (iswalnum(word[iword-1])) {
+ break;
+ }
+ if (word[iword-1] == L'.' || word[iword-1] == L'!' || word[iword-1] == L'?') {
+ cooldown += wpm_ns;
+ break;
+ }
+ iword--;
}
cooldown += wpm_ns;