about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-07 22:15:16 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-07 22:15:16 +0200
commit42563d12fe70f8eaa4c765940e9bcaebf213c1cb (patch)
treef6c307b82124397bb4de056124a94cd75dbdc63b /src
parenta5f98a151207ffe823a8024721e37e320d97f241 (diff)
downloadchawan-42563d12fe70f8eaa4c765940e9bcaebf213c1cb.tar.gz
lineedit: small cleanup
Diffstat (limited to 'src')
-rw-r--r--src/local/lineedit.nim5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/local/lineedit.nim b/src/local/lineedit.nim
index 17b343aa..ecfc3db8 100644
--- a/src/local/lineedit.nim
+++ b/src/local/lineedit.nim
@@ -128,10 +128,7 @@ proc insertCharseq(edit: LineEdit; s: string) =
   edit.escNext = false
   if s.len == 0:
     return
-  let rem = edit.news.substr(edit.cursori)
-  edit.news.setLen(edit.cursori)
-  edit.news &= s
-  edit.news &= rem
+  edit.news.insert(s, edit.cursori)
   edit.cursori += s.len
   edit.cursorx += s.notwidth()
   edit.redraw = true