summaryrefslogtreecommitdiff
path: root/xP
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-08-25 21:20:50 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-08-25 22:48:31 +0200
commit34521e61c1f0c44bc9018d5a7a861baf6888d5fc (patch)
tree3b9e87a3a728cb7a92726a1a7c3c10afe75723b5 /xP
parentc22dd67fc16ad4070fdeec264f7538764ba7a19e (diff)
downloadxK-34521e61c1f0c44bc9018d5a7a861baf6888d5fc.tar.gz
xK-34521e61c1f0c44bc9018d5a7a861baf6888d5fc.tar.xz
xK-34521e61c1f0c44bc9018d5a7a861baf6888d5fc.zip
xP/xW: fix buffer rename handling
Maintaining string pointers to the current/last buffer means that renames invalidate them.
Diffstat (limited to 'xP')
-rw-r--r--xP/public/xP.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 5dd578d..e4f5647 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -344,6 +344,11 @@ rpcEventHandlers.set(Relay.Event.BufferStats, e => {
rpcEventHandlers.set(Relay.Event.BufferRename, e => {
buffers.set(e.new, buffers.get(e.bufferName))
buffers.delete(e.bufferName)
+
+ if (e.bufferName === bufferCurrent)
+ bufferCurrent = e.new
+ if (e.bufferName === bufferLast)
+ bufferLast = e.new
})
rpcEventHandlers.set(Relay.Event.BufferRemove, e => {