From 9c6826011fd42546e403d016bf22e7965fd3392b Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 19 Mar 2025 09:17:46 -0500 Subject: [PATCH] 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. --- plugin/fetch.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fetch.vim b/plugin/fetch.vim index e596cdc..c8fec7e 100644 --- a/plugin/fetch.vim +++ b/plugin/fetch.vim @@ -24,7 +24,7 @@ if has('autocmd') " " 1. check new files for a spec when Vim has finished its init sequence... autocmd BufNewFile * - \ execute 'autocmd fetch VimEnter * nested call fetch#buffer("'.escape(expand(':p'), ' \\').'")' + \ execute 'autocmd fetch VimEnter * nested call fetch#buffer("'.escape(expand(':p'), ' \\"').'")' " 2. ... and start checking directly once the init sequence is complete autocmd VimEnter * \ execute 'autocmd! fetch BufNewFile * nested call fetch#buffer(expand(":p"))'