feat(editor): support Vim config file

This commit is contained in:
TuZaaaaa authored and GitHub committed 2026-09-29 22:25:59 +08:00
1 parent 4269a61e2c
commit dcaa0932f1
9 files changed
+347 -7

No files matched your search

+3 -3
View File
@@ -6,11 +6,11 @@ const capability = JSON.parse(readFileSync(new URL("../../src-tauri/capabilities
permissions: (string | ScopedPermission)[];
};
it("grants only exists and readTextFile command scopes for the exact UI tuning file", () => {
it("grants only exists and readTextFile command scopes for the exact UI tuning and Vim config files", () => {
const scopes = capability.permissions.filter((permission): permission is ScopedPermission => typeof permission !== "string" && permission.identifier.startsWith("fs:"));
expect(scopes).toEqual([
{ identifier: "fs:allow-exists", allow: [{ path: "$HOME/.dbx/ui-tuning.json" }] },
{ identifier: "fs:allow-read-text-file", allow: [{ path: "$HOME/.dbx/ui-tuning.json" }] },
{ identifier: "fs:allow-exists", allow: [{ path: "$HOME/.dbx/ui-tuning.json" }, { path: "$HOME/.dbx/vimrc" }] },
{ identifier: "fs:allow-read-text-file", allow: [{ path: "$HOME/.dbx/ui-tuning.json" }, { path: "$HOME/.dbx/vimrc" }] },
]);
expect(capability.permissions).not.toContain("fs:scope");
expect(capability.permissions.filter((permission) => typeof permission === "string" && permission.startsWith("fs:"))).toEqual(["fs:default", "fs:allow-write-file", "fs:allow-write-text-file", "fs:allow-stat", "fs:allow-read-file", "fs:allow-open", "fs:allow-read"]);