Skip to content

Commit 795eb66

Browse files
committed
feat:
- commented initial nvim-ui-plus autocmd
1 parent a3ad75e commit 795eb66

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/index.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ const { activate, deactivate } = defineExtension(async () => {
1616
return
1717
}
1818

19-
// Try to activate the vscode-neovim extension if it's not already active
20-
if (!vscode_nvim_ext.isActive) {
21-
logger.info('Activating vscode-neovim extension...')
22-
try {
23-
await vscode_nvim_ext.activate()
24-
logger.info('vscode-neovim extension activated successfully')
25-
}
26-
catch (err) {
27-
logger.error('Failed to activate vscode-neovim extension:', err)
28-
window.showErrorMessage('Failed to activate vscode-neovim extension')
29-
return
30-
}
19+
// Use the whenReady method which returns a promise that resolves when the extension is activated
20+
try {
21+
// Wait for the extension to be activated by VSCode
22+
await vscode_nvim_ext.activate()
23+
logger.info('vscode-neovim extension is active')
24+
25+
// Continue with the rest of your extension initialization
26+
// ...
27+
}
28+
catch (err) {
29+
logger.error('Failed to wait for vscode-neovim extension:', err)
30+
window.showErrorMessage('Failed to connect to vscode-neovim extension')
31+
return
3132
}
3233

3334
// Set up the mode manager

0 commit comments

Comments
 (0)