diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-30 17:16:16 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-30 17:36:29 +0200 |
commit | c4707e2803c26885d1938d320db5b368a221ffea (patch) | |
tree | 22289e6dcc39d9181bc0c0e984fe650aaf81feb3 /xP | |
parent | 46d68eacce700e675ce534fe948024f939a968c8 (diff) | |
download | xK-c4707e2803c26885d1938d320db5b368a221ffea.tar.gz xK-c4707e2803c26885d1938d320db5b368a221ffea.tar.xz xK-c4707e2803c26885d1938d320db5b368a221ffea.zip |
xC/xP: send buffer input history during sync
This transfer is currenly quite simplistic,
but it paves the way for further extensions.
Diffstat (limited to 'xP')
-rw-r--r-- | xP/public/xP.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index a7b7b11..795641d 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -387,6 +387,15 @@ rpcEventHandlers.set(Relay.Event.BufferActivate, e => { } }) +rpcEventHandlers.set(Relay.Event.BufferInput, e => { + let b = buffers.get(e.bufferName) + if (b === undefined) + return + if (b.historyAt == b.history.length) + b.historyAt++ + b.history.push(e.text) +}) + rpcEventHandlers.set(Relay.Event.BufferClear, e => { let b = buffers.get(e.bufferName) if (b !== undefined) |