Skip to content

Commit 9c68260

Browse files
committed
Fix error when opening new files containing quotes
`vim-fetch` gave this error when opening a new file that contained quotes: Error detected while processing VimEnter Autocommands for "*": E116: Invalid arguments for function fetch#buffer For example, `vim '"ok".txt'` would give an error if `"ok".txt` didn't exist. This was happening because the quotes weren't being properly escaped. This fixes that and removes the error. I tested this with my personal configuration and on a completely fresh virtual machine.
1 parent db3fd95 commit 9c68260

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/fetch.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if has('autocmd')
2424
"
2525
" 1. check new files for a spec when Vim has finished its init sequence...
2626
autocmd BufNewFile *
27-
\ execute 'autocmd fetch VimEnter * nested call fetch#buffer("'.escape(expand('<afile>:p'), ' \\').'")'
27+
\ execute 'autocmd fetch VimEnter * nested call fetch#buffer("'.escape(expand('<afile>:p'), ' \\"').'")'
2828
" 2. ... and start checking directly once the init sequence is complete
2929
autocmd VimEnter *
3030
\ execute 'autocmd! fetch BufNewFile * nested call fetch#buffer(expand("<afile>:p"))'

0 commit comments

Comments
 (0)