about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--command.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/command.c b/command.c
index 4fb58da..23b5e89 100644
--- a/command.c
+++ b/command.c
@@ -419,11 +419,10 @@ static void commandWindow(uint id, char *params) {
 			windowShow(windowFor(id));
 			return;
 		}
-		struct Cursor curs = {0};
-		for (const char *match; (match = cacheSearch(&curs, None, params));) {
-			id = idFind(match);
+		for (struct Cursor curs = {0}; cacheSearch(&curs, None, params);) {
+			id = idFind(curs.entry->key);
 			if (!id) continue;
-			cacheAccept(&curs);
+			cacheTouch(&curs);
 			windowShow(windowFor(id));
 			break;
 		}