about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/io')
-rw-r--r--src/io/lineedit.nim8
-rw-r--r--src/io/loader.nim5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/io/lineedit.nim b/src/io/lineedit.nim
index b453bef5..67b6194b 100644
--- a/src/io/lineedit.nim
+++ b/src/io/lineedit.nim
@@ -152,7 +152,7 @@ proc readLine*(current: var string, minlen, maxlen: int): bool =
     of ACTION_LINED_BACKSPACE:
       if state.cursor > 0:
         let w = state.news[state.cursor - 1].lwidth()
-        state.news.delete(state.cursor - 1, state.cursor - 1)
+        state.news.delete(state.cursor - 1..state.cursor - 1)
         dec state.cursor
         if state.cursor == state.news.len and state.shift == 0:
           state.backward(w)
@@ -162,7 +162,7 @@ proc readLine*(current: var string, minlen, maxlen: int): bool =
     of ACTION_LINED_DELETE:
       if state.cursor > 0 and state.cursor < state.news.len:
         let w = state.news[state.cursor - 1].lwidth()
-        state.news.delete(state.cursor, state.cursor)
+        state.news.delete(state.cursor..state.cursor)
         if state.cursor == state.news.len and state.shift == 0:
           state.kill(w)
         else:
@@ -171,7 +171,7 @@ proc readLine*(current: var string, minlen, maxlen: int): bool =
       state.escNext = true
     of ACTION_LINED_CLEAR:
       if state.cursor > 0:
-        state.news.delete(0, state.cursor - 1)
+        state.news.delete(0..state.cursor - 1)
         state.cursor = 0
         state.zeroShiftRedraw()
     of ACTION_LINED_KILL:
@@ -232,7 +232,7 @@ proc readLine*(current: var string, minlen, maxlen: int): bool =
           break
       if chars > 0:
         let w = state.news.lwidth(state.cursor - chars, state.cursor)
-        state.news.delete(state.cursor - chars, state.cursor - 1)
+        state.news.delete(state.cursor - chars..state.cursor - 1)
         state.cursor -= chars
         if state.cursor == state.news.len and state.shift == 0:
           state.backward(w)
diff --git a/src/io/loader.nim b/src/io/loader.nim
index 3ef5320e..5bd35a90 100644
--- a/src/io/loader.nim
+++ b/src/io/loader.nim
@@ -20,7 +20,10 @@ proc newFileLoader*(): FileLoader =
 
 proc getPage*(loader: FileLoader, url: Url): LoadResult =
   if url.scheme == "file":
-    let path = url.path.serialize_unicode()
+    when defined(windows) or defined(OS2) or defined(DOS):
+      let path = url.path.serialize_unicode_windows()
+    else:
+      let path = url.path.serialize_unicode()
     result.contenttype = guessContentType(path)
     result.s = newFileStream(path, fmRead)
   elif url.scheme == "http" or url.scheme == "https":