@@ -24,7 +24,7 @@ import {
2424import { defaultSourceOptions } from "./base/source.ts" ;
2525import type { BaseSource } from "./base/source.ts" ;
2626import type { Loader } from "./loader.ts" ;
27- import { convertUserString , printError , treePath2Filename } from "./utils.ts" ;
27+ import { convertTreePath , convertUserString , printError , treePath2Filename } from "./utils.ts" ;
2828import type {
2929 AvailableSourceInfo ,
3030 GatherStateAbortable ,
@@ -723,6 +723,10 @@ export class Ddu {
723723 items : allItems ,
724724 } ) ;
725725
726+ if ( restoreTree ) {
727+ await this . restoreTree ( denops , { preventRedraw : true , signal } ) ;
728+ }
729+
726730 const searchPath = this . #searchPath;
727731
728732 let searchTargetItem : DduItem | undefined ;
@@ -771,10 +775,6 @@ export class Ddu {
771775 }
772776 } ) ) ;
773777
774- if ( restoreTree ) {
775- this . restoreTree ( denops , { preventRedraw : true , signal } ) ;
776- }
777-
778778 if ( this . #context. done && this . #options. profile ) {
779779 await printError (
780780 denops ,
@@ -1926,14 +1926,6 @@ function chompTreePath(treePath?: TreePath): TreePath {
19261926 return treePath ;
19271927}
19281928
1929- function convertTreePath ( treePath ?: TreePath ) : string [ ] {
1930- return typeof treePath === "string"
1931- ? treePath . split ( pathsep )
1932- : ! treePath
1933- ? [ ]
1934- : treePath ;
1935- }
1936-
19371929function isParentPath ( checkPath : string [ ] , searchPath : string [ ] ) {
19381930 return checkPath !== searchPath &&
19391931 searchPath . join ( pathsep ) . startsWith ( checkPath . join ( pathsep ) + pathsep ) ;
0 commit comments