about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/local/container.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index 21981049..011c7279 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -260,6 +260,7 @@ func cursorFirstX(container: Container): int =
     if w + tw > cc:
       return w
     w += tw
+  return w
 
 # Returns the X position of the last cell occupied by the character the cursor
 # currently points to.
@@ -513,8 +514,9 @@ proc setCursorX(container: Container, x: int, refresh = true, save = true)
     # target x is before the screen start
     if x2 < container.cursorx:
       # desired X position is lower than cursor X; move screen back to the
-      # desired position if valid, otherwise the last cell of the current line.
-      if x2 == x:
+      # desired position if valid, to 0 if the desired position is less than 0,
+      # otherwise the last cell of the current line.
+      if x2 <= x:
         container.setFromX(x, false)
       else:
         container.setFromX(cw - 1, false)
>1710c90 ^
cc03f6f ^



6394e38 ^








3139148 ^
1710c90 ^
d603bbe ^
6394e38 ^
d603bbe ^
6394e38 ^



4074445 ^
6394e38 ^









cc03f6f ^



3139148 ^
6394e38 ^
d603bbe ^
cc03f6f ^
d603bbe ^
cc03f6f ^

d603bbe ^
3139148 ^
d603bbe ^

6394e38 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77