Skip to content

Commit

Permalink
Execute cursorNext action if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jul 15, 2024
1 parent 72a8150 commit 49d162a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@ export class Ddu {
maxLevel,
preventRedraw: true,
isGrouped: item.isGrouped ?? false,
isInDirectory: item.isInDirectory ?? false,
signal,
},
);
Expand All @@ -1176,6 +1177,7 @@ export class Ddu {
maxLevel?: number;
preventRedraw?: boolean;
isGrouped?: boolean;
isInDirectory?: boolean;
signal?: AbortSignal;
},
): Promise<DduItem /* searchedItem */ | undefined> {
Expand Down Expand Up @@ -1403,6 +1405,15 @@ export class Ddu {
}
}

if (options.isInDirectory && children.length > 0 && !isGrouped) {
// NOTE: To enter the expanded directory, execute "cursorNext" action
await this.uiAction(
denops,
"cursorNext",
{},
);
}

return searchedItem;
}

Expand Down
1 change: 1 addition & 0 deletions denops/ddu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export type ExpandItem = {
maxLevel?: number;
search?: TreePath;
isGrouped?: boolean;
isInDirectory?: boolean;
};

export type DduFilterItems = DduItem[] | {
Expand Down

0 comments on commit 49d162a

Please sign in to comment.