Make Alt+a fallback to server buffer

This commit is contained in:
Simon Ser 2020-08-13 15:41:38 +02:00
parent 028382aab3
commit 012b9f515a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -1,4 +1,4 @@
import { ReceiptType, Unread } from "/state.js"; import { ReceiptType, Unread, SERVER_BUFFER } from "/state.js";
export const keybindings = [ export const keybindings = [
{ {
@ -28,12 +28,14 @@ export const keybindings = [
description: "Jump to next buffer with activity", description: "Jump to next buffer with activity",
execute: (app) => { execute: (app) => {
// TODO: order by priority, then by age // TODO: order by priority, then by age
var target = SERVER_BUFFER;
for (var buf of app.state.buffers.values()) { for (var buf of app.state.buffers.values()) {
if (buf.unread != Unread.NONE) { if (buf.unread != Unread.NONE) {
app.switchBuffer(buf.name); target = buf.name;
break; break;
} }
} }
app.switchBuffer(target);
}, },
}, },
{ {