From: Simon Désaulniers Date: Mon, 4 May 2015 22:05:41 +0000 (-0400) Subject: adding VersionAwareNetrwBrowseX() function for doing right call to netrw browsex X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/df5d5c5adb5ff6a087e1e837aaaa25e22ba74d70?ds=sidebyside;hp=75730054adb91fd80d6eb3e6ffd76e2062fb193b adding VersionAwareNetrwBrowseX() function for doing right call to netrw browsex --- 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