about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2021-12-20 18:10:15 +0100
committerbptato <nincsnevem662@gmail.com>2021-12-20 18:12:13 +0100
commit8f4b4977eed45bbe961a9fe3f7d75d93f53015c4 (patch)
treee87cea77e50b7f6488ca8d40eedec0003f59b63f /src/utils/twtstr.nim
parent21e30acaaf8b16afc4730f0355c6b32618b3003a (diff)
downloadchawan-8f4b4977eed45bbe961a9fe3f7d75d93f53015c4.tar.gz
Fix and implement cursor movement commands
In particular, cursorNextLink and cursorPrevLink now work and some other
commands have been improved
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r--src/utils/twtstr.nim15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index 9e88b9cd..01f3cfb4 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -11,27 +11,18 @@ import sequtils
 when defined(posix):
   import posix
 
-func ansiStyle*(str: string, style: Style): seq[string] =
+func ansiStyle*(str: string, style: Style): string =
   result &= ansiStyleCode(style)
   result &= str
 
-func ansiFgColor*(str: string, color: ForegroundColor): seq[string] =
+func ansiFgColor*(str: string, color: ForegroundColor): string =
   result &= ansiForegroundColorCode(color)
   result &= str
 
-func ansiReset*(str: string): seq[string] =
+func ansiReset*(str: string): string =
   result &= str
   result &= ansiResetCode
 
-func ansiStyle*(str: seq[string], style: Style): seq[string] =
-  return ansiStyleCode(style) & str
-
-func ansiFgColor*(str: seq[string], color: ForegroundColor): seq[string] =
-  return ansiForegroundColorCode(color) & str
-
-func ansiReset*(str: seq[string]): seq[string] =
-  return str & ansiResetCode
-
 func maxString*(str: string, max: int): string =
   if max < str.runeLen():
     return str.runeSubstr(0, max - 2) & "$"