From a099a2cf3c819fb5e03f1abbea1bd17e32baa49e Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 4 Jul 2014 11:23:28 +0200 Subject: [PATCH] Disable 'shellslash' on Windows to avoid problems Probably fix #54 --- autoload/vimwiki/base.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0fec726..b1a102c 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -466,7 +466,18 @@ function! vimwiki#base#system_open_link(url) "{{{ " handlers function! s:win32_handler(url) "http://vim.wikia.com/wiki/Opening_current_Vim_file_in_your_Windows_browser - execute 'silent ! start "Title" /B ' . shellescape(a:url, 1) + "disable 'shellslash', otherwise the url will be enclosed in single quotes, + "which is problematic + "see https://github.com/vimwiki/vimwiki/issues/54#issuecomment-48011289 + if exists('+shellslash') + let old_ssl = &shellslash + set noshellslash + let url = shellescape(a:url, 1) + let &shellslash = old_ssl + else + let url = shellescape(a:url, 1) + endif + execute 'silent ! start "Title" /B ' . url endfunction function! s:macunix_handler(url) execute '!open ' . shellescape(a:url, 1)