avoid unload new document on rename

This commit is contained in:
Qiming Zhao 2022-07-31 18:34:26 +08:00
parent 8234e83f92
commit 4571c863ad
No known key found for this signature in database
GPG key ID: 9722CD0E8D4DCB8C

View file

@ -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(