Skip to content

Commit 1664544

Browse files
Mike Sharpevim-scripts
Mike Sharpe
authored andcommittedNov 6, 2010
Version 2.17
Fix a bug were spaces in filenames and/or directory names would prevent the alternate file being openned. Thanks to Nathan Stien (for the bug report and patch) and Soeren Sonnenburg (for the bug report).
1 parent d4182e8 commit 1664544

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎plugin/a.vim

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
" Directory & regex enhancements added by Bindu Wavell who is well known on
1313
" vim.sf.net
14+
"
15+
" Patch for spaces in files/directories from Nathan Stien (also reported by
16+
" Soeren Sonnenburg)
1417

1518
" Do not load a.vim if is has already been loaded.
1619
if exists("loaded_alternateFile")
@@ -685,7 +688,7 @@ endfunction
685688
" + implemented fix from Matt Perry
686689
function! <SID>FindOrCreateBuffer(fileName, doSplit, findSimilar)
687690
" Check to see if the buffer is already open before re-opening it.
688-
let FILENAME = a:fileName
691+
let FILENAME = escape(a:fileName, ' ')
689692
let bufNr = -1
690693
let lastBuffer = bufnr("$")
691694
let i = 1

0 commit comments

Comments
 (0)
Failed to load comments.