about summary refs log tree commit diff stats
path: root/src/buffer
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-05 21:15:48 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-05 21:15:48 +0100
commit36ec45f5c0a9db4326411653f10e9b1262e789a9 (patch)
treef8fbe796a2d1c7c306651402b87b8e39ad1119ae /src/buffer
parentc392ff7ed6499e00376737d4f2ffccccdee27c76 (diff)
downloadchawan-36ec45f5c0a9db4326411653f10e9b1262e789a9.tar.gz
Trigger status event when number of lines changed
(So that line information is updated automatically)
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/container.nim12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/buffer/container.nim b/src/buffer/container.nim
index e24b0342..58e6d350 100644
--- a/src/buffer/container.nim
+++ b/src/buffer/container.nim
@@ -258,11 +258,13 @@ proc triggerEvent(container: Container, t: ContainerEventType) =
 proc updateCursor(container: Container)
 
 proc setNumLines(container: Container, lines: int, finish = false) =
-  container.numLines = lines
-  if container.startpos.isSome and finish:
-    container.pos = container.startpos.get
-    container.startpos = none(CursorPosition)
-  container.updateCursor()
+  if container.numLines != lines:
+    container.numLines = lines
+    if container.startpos.isSome and finish:
+      container.pos = container.startpos.get
+      container.startpos = none(CursorPosition)
+    container.updateCursor()
+    container.triggerEvent(STATUS)
 
 proc requestLines*(container: Container, w = container.lineWindow) =
   container.iface.getLines(w).then(proc(res: tuple[numLines: int, lines: seq[SimpleFlexibleLine]]) =
the previous revision' href='/ahoang/chawan/blame/src/io/loader.nim?id=e7ea9c408667a4fdfefc369e51d72c3cfb9c1ee9'>^
a78c2619 ^
4874b92f ^
04fe0c11 ^


d9e430c8 ^
51ea622d ^
e80ae4b1 ^
010185f7 ^
e38402df ^
010185f7 ^
896489a6 ^





e2203257 ^
e80ae4b1 ^





896489a6 ^
a78c2619 ^




302e6cd0 ^

e38402df ^



a6bbcd0d ^
e80ae4b1 ^
a78c2619 ^
e38402df ^
896489a6 ^
51ea622d ^
08a758ed ^






a6bbcd0d ^



a78c2619 ^
51ea622d ^
a78c2619 ^
896489a6 ^




940325ab ^
e80ae4b1 ^
4874b92f ^


e80ae4b1 ^
4874b92f ^

e80ae4b1 ^
672ab553 ^
e80ae4b1 ^
672ab553 ^

e80ae4b1 ^



4874b92f ^
fb8bbaa6 ^
896489a6 ^
fb8bbaa6 ^
896489a6 ^
4b482418 ^
a78c2619 ^
a78c2619 ^
51ea622d ^
a78c2619 ^
51ea622d ^
a78c2619 ^

15e6a231 ^

51d83224 ^
15e6a231 ^
896489a6 ^
51ea622d ^


e38402df ^
51ea622d ^

e38402df ^

51ea622d ^
08a758ed ^
e38402df ^
5da4c6e6 ^
310254b0 ^
5da4c6e6 ^













e38402df ^
51ea622d ^
15e6a231 ^

a78c2619 ^
896489a6 ^



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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157