From 4571c863ad692d7002123fc6774338f6d5713b49 Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Sun, 31 Jul 2022 18:34:26 +0800 Subject: [PATCH] avoid unload new document on rename --- src/server/features/updatePathOnRename.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/features/updatePathOnRename.ts b/src/server/features/updatePathOnRename.ts index fb783f3..c7500f3 100644 --- a/src/server/features/updatePathOnRename.ts +++ b/src/server/features/updatePathOnRename.ts @@ -61,11 +61,11 @@ export default class UpdateImportsOnFileRenameHandler { await workspace.nvim.command(`silent ${oldDocument.bufnr}bwipeout!`) } let document = workspace.getDocument(newUri) - if (document) { - await workspace.nvim.command(`silent ${document.bufnr}bwipeout!`) - await wait(30) + if (!document) { + document = await workspace.loadFile(newUri) + } else { + workspace.nvim.command('checktime', true) } - document = await workspace.loadFile(newUri) if (!document) return await wait(50) const edits = await this.getEditsForFileRename(