From 6143d179eddc05f57ed3ae0d3ca65f5871938896 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 2 Jun 2024 10:37:25 +0900 Subject: [PATCH] Fix refreshItems behavior --- denops/ddu/ddu.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/denops/ddu/ddu.ts b/denops/ddu/ddu.ts index 397c4c8..d3f3f06 100644 --- a/denops/ddu/ddu.ts +++ b/denops/ddu/ddu.ts @@ -1133,7 +1133,7 @@ export class Ddu { await this.refresh(denops); - if (searchPath.length <= 0) { + if (searchPath.length > 0) { // NOTE: If searchPath exists, expandItems() is executed. await this.restoreTree(denops); } @@ -1756,6 +1756,10 @@ export class Ddu { async restoreTree( denops: Denops, ): Promise { + if (this.#expandedItems.size === 0) { + return; + } + await this.expandItems( denops, [...this.#expandedItems.values()].map((item) => ({