about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-30 18:02:48 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-30 19:02:05 +0200
commit31fbd611aa107cc023dcf1e1358f19ff58f14075 (patch)
treec3360c2f4575a249bb30f18b746ab3a0ce0c91b2 /src/utils
parentbb2c7cb87a99f790b6c741f85de666dd7aeae10c (diff)
downloadchawan-31fbd611aa107cc023dcf1e1358f19ff58f14075.tar.gz
Add urimethodmap support
yay
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/twtstr.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index ca79fa76..d8ce9ae8 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -206,13 +206,11 @@ func skipBlanks*(buf: string, at: int): int =
   while result < buf.len and buf[result].isWhitespace():
     inc result
 
-func until*(s: string, c: set[char]): string =
-  var i = 0
-  while i < s.len:
+func until*(s: string, c: set[char], starti = 0): string =
+  for i in starti ..< s.len:
     if s[i] in c:
       break
     result.add(s[i])
-    inc i
 
 func until*(s: string, c: char): string = s.until({c})