about summary refs log tree commit diff
path: root/complete.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-17 18:43:26 -0400
committerJune McEnroe <june@causal.agency>2021-06-17 18:52:47 -0400
commit0d888b88d0d8e4853e0d23e00b3183a7b60ab877 (patch)
tree42c2cb300ce6439a9d00e0293e2acb1c1a5abc38 /complete.c
parentClean up if restricted && logEnable, pipe creation (diff)
downloadtest-0d888b88d0d8e4853e0d23e00b3183a7b60ab877.tar.gz
test-0d888b88d0d8e4853e0d23e00b3183a7b60ab877.zip
Match windows by substring in /window
This could just iterate over idNames instead, but using complete
means more recently used windows will match first.
Diffstat (limited to '')
-rw-r--r--complete.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/complete.c b/complete.c
index 5835926..ead2457 100644
--- a/complete.c
+++ b/complete.c
@@ -119,6 +119,15 @@ const char *complete(uint id, const char *prefix) {
 	return NULL;
 }
 
+const char *completeSubstr(uint id, const char *substr) {
+	for (match = (match ? match->next : head); match; match = match->next) {
+		if (match->id && match->id != id) continue;
+		if (!strcasestr(match->str, substr)) continue;
+		return match->str;
+	}
+	return NULL;
+}
+
 void completeAccept(void) {
 	if (match) prepend(detach(match));
 	match = NULL;
4204b0890&follow=1'>Set cursor theme and sizeJune McEnroe 2021-02-07Use scrot for up -s if no screencaptureJune McEnroe 2021-02-07Enable mouse acceleration in XJune McEnroe 2021-02-07Set colours for Xt and cwmJune McEnroe 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 2021-02-07Fully configure and rebind cwmJune McEnroe 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe 2021-02-06Add xterm output to schemeJune McEnroe