Skip to content

Commit

Permalink
fix vim command hangs on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Jul 28, 2024
1 parent b4bfe30 commit 1745a25
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/vim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,18 @@ export async function installVimOnWindows(tag: string, dirSuffix: string): Promi
const url = `https://github.com/vim/vim-win32-installer/releases/download/${tag}/gvim_${ver}_x64.zip`;
const file = `gvim_${ver}_x64.zip`;
const destDir = await installVimAssetOnWindows(file, url, dirSuffix);
const executable = exeName(false, 'windows');

// From v9.1.0631, vim.exe and gvim.exe share the same core, so OLE is enabled even in vim.exe.
// This command registers the vim64.dll as a type library. Without the command, vim.exe will
// ask the registration with GUI dialog and the process looks hanging. (#37)
//
// See: https://github.com/vim/vim/issues/15372
const bin = path.join(destDir, executable);
await exec(bin, ['-silent', '-register']);

return {
executable: exeName(false, 'windows'),
executable,
binDir: destDir,
};
}
Expand Down

0 comments on commit 1745a25

Please sign in to comment.