mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
/mode: use active buffer if omitted
This commit is contained in:
parent
a0c85c3372
commit
e2e2f7a8fc
1 changed files with 8 additions and 0 deletions
|
@ -93,6 +93,14 @@ export default {
|
|||
usage: "<target> <modes> [mode args...]",
|
||||
description: "Change channel or user mode",
|
||||
execute: (app, args) => {
|
||||
var target = args[0];
|
||||
if (target.startsWith("+") || target.startsWith("-")) {
|
||||
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
|
||||
if (!activeBuffer || !app.isChannel(activeBuffer.name)) {
|
||||
throw new Error("Not in a channel");
|
||||
}
|
||||
args = [activeBuffer.name, ...args];
|
||||
}
|
||||
getActiveClient(app).send({ command: "MODE", params: args });
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue