mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-28 18:26:19 -05:00
Add Alt+Up/Down key bindings
This commit is contained in:
parent
6c93bd13d1
commit
aaa33d7f36
1 changed files with 33 additions and 0 deletions
|
@ -36,6 +36,39 @@ export const keybindings = [
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "ArrowUp",
|
||||
altKey: true,
|
||||
description: "Jump to the previous buffer",
|
||||
execute: (app) => {
|
||||
var prev = null;
|
||||
for (var buf of app.state.buffers.values()) {
|
||||
if (app.state.activeBuffer == buf.name) {
|
||||
if (prev) {
|
||||
app.switchBuffer(prev.name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
prev = buf;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
key: "ArrowDown",
|
||||
altKey: true,
|
||||
description: "Jump to the next buffer",
|
||||
execute: (app) => {
|
||||
var found = false;
|
||||
for (var buf of app.state.buffers.values()) {
|
||||
if (found) {
|
||||
app.switchBuffer(buf.name);
|
||||
break;
|
||||
} else if (app.state.activeBuffer == buf.name) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export function setup(app) {
|
||||
|
|
Loading…
Reference in a new issue