summaryrefslogtreecommitdiff
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
parenta20572b4b15a63e3a2df3c59cf3f59409e0c4718 (diff)
pad cooldown: lax punctuation word position
-rwxr-xr-xsrc/spreed.c11
-rw-r--r--test.txt1
2 files changed, 10 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;
diff --git a/test.txt b/test.txt
index ed00213..207eb45 100644
--- a/test.txt
+++ b/test.txt
@@ -1,4 +1,5 @@
this ain't workin.
+https://google.com
1
22
333