Use fnameescape to quote filenames for :badd.

This commit is contained in:
Zachary Voase 2016-06-30 16:21:13 -07:00
parent 2e2b649232
commit 916f6b8f8f

View File

@ -74,7 +74,7 @@ endfunction
function! s:promptToRenameBuffer(bufnum, msg, newFileName) function! s:promptToRenameBuffer(bufnum, msg, newFileName)
echo a:msg echo a:msg
if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y' if g:NERDTreeAutoDeleteBuffer || nr2char(getchar()) ==# 'y'
let quotedFileName = "'" . a:newFileName . "'" let quotedFileName = fnameescape(a:newFilename)
" 1. ensure that a new buffer is loaded " 1. ensure that a new buffer is loaded
exec "badd " . quotedFileName exec "badd " . quotedFileName
" 2. ensure that all windows which display the just deleted filename " 2. ensure that all windows which display the just deleted filename