diff --git a/autoload/riv/link.vim b/autoload/riv/link.vim index f603939..956dc89 100644 --- a/autoload/riv/link.vim +++ b/autoload/riv/link.vim @@ -19,7 +19,9 @@ fun! riv#link#browse(link) "{{{ if link =~ s:p.link_mail let link = 'mailto:' . link endif - call s:sys(g:riv_web_browser." ". escape(link,'#%')." &") + " call s:sys(g:riv_web_browser." ". escape(link,'#%')." &") + echom link + call riv#util#open(link) endfun "}}} fun! s:cursor(row, col) "{{{ " Move to cursor with jumplist changed. @@ -231,7 +233,8 @@ fun! riv#link#open(...) "{{{ call riv#file#edit(expand(mo.groups[4])) else " vim will expand the # and % , so escape it. - call riv#link#browse(mo.groups[4]) + " XXX: the groups[4] will remove the http/https , so use entire + call riv#link#browse(mo.groups[0]) endif else if mo.groups[3] =~ s:p.link_mail @@ -372,7 +375,7 @@ fun! riv#link#hi_hover() "{{{ endfun "}}} if expand(':p') == expand('%:p') "{{{ - call doctest#start() + " call doctest#start() endif "}}} let &cpo = s:cpo_save unlet s:cpo_save diff --git a/autoload/riv/publish.vim b/autoload/riv/publish.vim index dccdfeb..d99e9de 100644 --- a/autoload/riv/publish.vim +++ b/autoload/riv/publish.vim @@ -288,10 +288,10 @@ fun! s:single2(ft, file, browse) "{{{ exe 'sp ' out_file elseif a:ft == "odt" " call s:sys(g:riv_ft_browser . ' '. shellescape(out_file) . ' &') - call riv#util#browse(shellescape(out_file), g:riv_ft_browser) + call riv#util#open(shellescape(out_file)) else " call s:sys(g:riv_web_browser . ' '. shellescape(out_file) . ' &') - call riv#util#browse(shellescape(out_file), g:riv_web_browser) + call riv#util#open(shellescape(out_file)) endif endif endfun "}}} @@ -364,11 +364,11 @@ fun! riv#publish#2(ft, file, path, browse) "{{{ exe 'sp ' out_file elseif a:ft == "odt" " call s:sys(g:riv_ft_browser . ' '. out_file . ' &') - call riv#util#browse(out_file, g:riv_ft_browser) + call riv#util#open(out_file) else let escaped_path = substitute(out_file, ' ', '\\ ', 'g') " call s:sys(g:riv_web_browser . ' '. escaped_path . ' &') - call riv#util#browse(escaped_path, g:riv_web_browser) + call riv#util#open(escaped_path) endif endif endfun "}}} @@ -376,7 +376,7 @@ endfun "}}} fun! riv#publish#browse() "{{{ let path = riv#path#build_ft('html') . 'index.html' " call s:sys(g:riv_web_browser . ' '. shellescape(path) . ' &') - call riv#util#browse(shellescape(path), g:riv_web_browser) + call riv#util#open(shellescape(path)) endfun "}}} fun! riv#publish#open_path() "{{{ exe 'sp ' riv#path#build_path()