about summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-27 00:17:59 -0500
committerJune McEnroe <june@causal.agency>2019-02-27 00:17:59 -0500
commitd8cffb8ae7c949a85b35a15f344fec592d7df060 (patch)
treec561b0a334cd842d41c2bc66f13d1e59b7c844a2 /input.c
parentAdd M-/ to switch to previously active window (diff)
downloadcatgirl-d8cffb8ae7c949a85b35a15f344fec592d7df060.tar.gz
catgirl-d8cffb8ae7c949a85b35a15f344fec592d7df060.zip
Add /move command
Diffstat (limited to '')
-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 },