From 0d888b88d0d8e4853e0d23e00b3183a7b60ab877 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 17 Jun 2021 18:43:26 -0400 Subject: Match windows by substring in /window This could just iterate over idNames instead, but using complete means more recently used windows will match first. --- command.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index b345e11..84cb68f 100644 --- a/command.c +++ b/command.c @@ -379,7 +379,17 @@ static void commandWindow(uint id, char *params) { uiShowNum(strtoul(params, NULL, 10)); } else { id = idFind(params); - if (id) uiShowID(id); + if (id) { + uiShowID(id); + return; + } + for (const char *match; (match = completeSubstr(None, params));) { + id = idFind(match); + if (!id) continue; + completeAccept(); + uiShowID(id); + break; + } } } -- cgit 1.4.0