diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-11 21:47:24 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-11 21:50:09 +0200 |
commit | b4ee523628b5e91ec06c6c8c61fe03507e1f412e (patch) | |
tree | 7624a9678da187a1ee22af81bab15279c6e0e12e /xP/public | |
parent | c3a52b9e4cd346cf7b8964a69105fdcd30c4ec05 (diff) | |
download | xK-b4ee523628b5e91ec06c6c8c61fe03507e1f412e.tar.gz xK-b4ee523628b5e91ec06c6c8c61fe03507e1f412e.tar.xz xK-b4ee523628b5e91ec06c6c8c61fe03507e1f412e.zip |
xP: bind buffer iteration to M-PageUp/PageDown
Diffstat (limited to 'xP/public')
-rw-r--r-- | xP/public/xP.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index f80182a..d3b2d16 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -817,11 +817,8 @@ document.addEventListener('keydown', event => { if (rpc.ws == undefined || !hasShortcutModifiers(event)) return + let names = undefined switch (event.key) { - case 'Tab': - if (bufferLast !== undefined) - bufferActivate(bufferLast) - break case 'h': bufferToggleLog() break @@ -839,6 +836,26 @@ document.addEventListener('keydown', event => { break } break + case 'Tab': + if (bufferLast !== undefined) + bufferActivate(bufferLast) + break + case 'PageUp': + names = [...buffers.keys()] + for (let i = 0; i < names.length; i++) + if (names[i] === bufferCurrent) { + bufferActivate(names.at(--i)) + break + } + break + case 'PageDown': + names = [...buffers.keys()] + for (let i = 0; i < names.length; i++) + if (names[i] === bufferCurrent) { + bufferActivate(names.at(++i) || names[0]) + break + } + break default: return } |