Skip to content

Commit

Permalink
fix(workspace): fix error on cancel rename
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed May 7, 2019
1 parent f555c14 commit 18f1bdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 18f1bdf

Please sign in to comment.