about summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input.c')
-rw-r--r--input.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/input.c b/input.c
index 45de9f1..bbbc0d3 100644
--- a/input.c
+++ b/input.c
@@ -117,6 +117,15 @@ static void inputMan(struct Tag tag, char *params) {
 	eventWait((const char *[]) { "man", "1", "catgirl", NULL });
 }
 
+static void inputMove(struct Tag tag, char *params) {
+	char *num = strsep(&params, " ");
+	if (num) {
+		uiMoveTag(tag, strtol(num, NULL, 0), num[0] == '+' || num[0] == '-');
+	} else {
+		uiLog(tag, UIHot, L"/move requires a number");
+	}
+}
+
 static void inputOpen(struct Tag tag, char *params) {
 	if (params && !isdigit(params[0])) {
 		urlOpenMatch(tag, params);
@@ -174,6 +183,7 @@ static const struct {
 	{ "/join", inputJoin },
 	{ "/man", inputMan },
 	{ "/me", inputMe },
+	{ "/move", inputMove },
 	{ "/names", inputWho },
 	{ "/nick", inputNick },
 	{ "/open", inputOpen },