diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-05 21:15:48 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-05 21:15:48 +0100 |
commit | 36ec45f5c0a9db4326411653f10e9b1262e789a9 (patch) | |
tree | f8fbe796a2d1c7c306651402b87b8e39ad1119ae /src/buffer | |
parent | c392ff7ed6499e00376737d4f2ffccccdee27c76 (diff) | |
download | chawan-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.nim | 12 |
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]]) = |