about summary refs log tree commit diff stats
path: root/src
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
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')
-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]]) =