about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-01-22 18:34:23 +0100
committerbptato <nincsnevem662@gmail.com>2022-01-22 18:34:23 +0100
commit7b06c22d8f24de727ce5b62b4d7fd8cd4007123d (patch)
treec92bd6243e249516ea51a0221c0e1b6c97adee48 /src/utils
parent4b5a3cbbf3ef3c75915f92d9ce487c0c9ff2884a (diff)
downloadchawan-7b06c22d8f24de727ce5b62b4d7fd8cd4007123d.tar.gz
Fix page navigation
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/twtstr.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index cb236b53..3050d50e 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -217,6 +217,14 @@ func skipBlanks*(buf: string, at: int): int =
   while result < buf.len and buf[result].isWhitespace():
     inc result
 
+func until*(s: string, c: char): string =
+  var i = 0
+  while i < s.len:
+    if s[i] == c:
+      break
+    result.add(s[i])
+    inc i
+
 func number_additive*(i: int, range: HSlice[int, int], symbols: openarray[(int, string)]): string =
   if i notin range:
     return $i