Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version: 22.x
- name: Install pnpm
uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm install --frozen-lockfile
- run: xvfb-run -a pnpm test
if: runner.os == 'Linux'
- run: pnpm test
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To open oil.code:

If you're using vscode-neovim and want to customize the keymaps for oil.code:

1. Set `oil-code.disableDefaultKeymaps` to `true` in your VSCode settings
1. Set `oil-code.disableVimKeymaps` to `true` in your VSCode settings
2. Add the following to your `init.lua` and customize as you like:

```lua
Expand Down Expand Up @@ -75,7 +75,7 @@ end

If you're using VSCodeVim and want to customize the keymaps for oil.code:

1. Set `oil-code.disableDefaultKeymaps` to `true` in your VSCode settings
1. Set `oil-code.disableVimKeymaps` to `true` in your VSCode settings
2. Add the following to your `settings.json` and customize as you like:

```json
Expand Down
23 changes: 18 additions & 5 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ async function insertIntoDocument(
assert.ok(applied, "Workspace edit was not applied");
}

async function deleteDocumentLine(document: vscode.TextDocument, line: number) {
const workspaceEdit = new vscode.WorkspaceEdit();
const range = line === document.lineCount - 1 && line > 0
? new vscode.Range(
document.lineAt(line - 1).range.end,
document.lineAt(line).range.end
)
: document.lineAt(line).rangeIncludingLineBreak;
workspaceEdit.delete(document.uri, range);
const applied = await vscode.workspace.applyEdit(workspaceEdit);
assert.ok(applied, "Workspace edit was not applied");
}

async function saveDocument(document: vscode.TextDocument) {
await sleep(200);
await document.save();
Expand Down Expand Up @@ -403,8 +416,8 @@ suite("oil.code", () => {
assert.ok(editor2, "No active editor2");
editor2.selection = new vscode.Selection(position, position);

// Cut selection
await vscode.commands.executeCommand("editor.action.deleteLines");
// Remove the source entry before recreating it under the destination.
await deleteDocumentLine(editor2.document, 2);
await waitForDocumentText(["/000 ../", "/001 sub-dir/"]);

// Move cursor to the new directory
Expand Down Expand Up @@ -477,7 +490,7 @@ suite("oil.code", () => {
// Move cursor to the file name
editor2.selection = new vscode.Selection(2, 5, 2, 5);

await vscode.commands.executeCommand("editor.action.deleteLines");
await deleteDocumentLine(editor2.document, 2);
await waitForDocumentText(["/000 ../", "/001 sub-dir/"]);

// Move cursor to the new directory
Expand Down Expand Up @@ -522,7 +535,7 @@ suite("oil.code", () => {
]);

editor.selection = new vscode.Selection(1, 5, 1, 5);
await vscode.commands.executeCommand("editor.action.deleteLines");
await deleteDocumentLine(editor.document, 1);
await waitForDocumentText(["/000 ../", "/002 oil-dir-parent/"]);
editor.selection = new vscode.Selection(1, 5, 1, 5);
await vscode.commands.executeCommand("oil-code.select");
Expand Down Expand Up @@ -569,7 +582,7 @@ suite("oil.code", () => {
]);

editor.selection = new vscode.Selection(1, 5, 1, 5);
await vscode.commands.executeCommand("editor.action.deleteLines");
await deleteDocumentLine(editor.document, 1);
await waitForDocumentText(["/000 ../", "/002 oil-dir-parent/"]);
editor.selection = new vscode.Selection(1, 5, 1, 5);
await vscode.commands.executeCommand("oil-code.select");
Expand Down
Loading