diff --git a/src/workspace.ts b/src/workspace.ts index e1cd5adcde1..45dc79c8355 100644 --- a/src/workspace.ts +++ b/src/workspace.ts @@ -1395,7 +1395,8 @@ augroup end` } let oldPath = Uri.parse(doc.uri).fsPath let newPath = await nvim.call('input', ['new path:', oldPath, 'file']) - if (newPath == oldPath) return + newPath = newPath ? newPath.trim() : null + if (newPath == oldPath || !newPath) return let lines = await doc.buffer.lines let exists = fs.existsSync(oldPath) if (exists) {