feat(nvim): display selected file in tree in the editor

This commit is contained in:
Pihkaal
2024-01-28 21:35:06 +01:00
parent 965fff6226
commit e778631828
7 changed files with 139 additions and 27 deletions

View File

@@ -25,6 +25,7 @@ export const FILE_STYLES: Record<string, Cell> = {
export type File = {
name: string;
path: string;
} & (
| {
type: "file";
@@ -54,17 +55,20 @@ export const buildFileTree = (manifest: Manifest): Array<File> => {
project.files.forEach(file => {
files.push({
name: file,
path: file,
type: "file",
});
});
} else {
files.push({
name: project.name,
path: project.name,
type: "directory",
folded: true,
children: sortFiles(
project.files.map(file => ({
name: file,
path: `${project.name}/${file}`,
type: "file",
})),
),