From c4707e2803c26885d1938d320db5b368a221ffea Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Fri, 30 Sep 2022 17:16:16 +0200 Subject: xC/xP: send buffer input history during sync This transfer is currenly quite simplistic, but it paves the way for further extensions. --- xP/public/xP.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xP') 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) -- cgit v1.2.3-70-g09d2