xC/xP: send buffer input history during sync

This transfer is currenly quite simplistic,
but it paves the way for further extensions.
This commit is contained in:
2022-09-30 17:16:16 +02:00
parent 46d68eacce
commit c4707e2803
3 changed files with 82 additions and 1 deletions

View File

@@ -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)