From: Ciro Santilli 六四事件 法轮功 Date: Tue, 5 May 2015 08:40:39 +0000 (+0200) Subject: Merge pull request #209 from sim590/version-aware-netrw-browsex-call X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/d12befde9cfc3d83c04c484107f2d0ac5dc40e45?hp=75730054adb91fd80d6eb3e6ffd76e2062fb193b Merge pull request #209 from sim590/version-aware-netrw-browsex-call Version aware netrw browseX call --- diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index d67864a..9b98767 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -504,12 +504,20 @@ endfunction function! s:OpenUrlUnderCursor() let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.')) if l:url != '' - call netrw#NetrwBrowseX(l:url, 0) + call s:VersionAwareNetrwBrowseX(l:url) else echomsg 'The cursor is not on a link.' endif endfunction +function! s:VersionAwareNetrwBrowseX(url) + if has('patch-7.4.567') + call netrw#BrowseX(a:url, 0) + else + call netrw#NetrwBrowseX(a:url, 0) + endif +endf + function! s:MapNotHasmapto(lhs, rhs) if !hasmapto('' . a:rhs) execute 'nmap ' . a:lhs . ' ' . a:rhs