X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/44ac1f42e98063e8148d1a67ed22dca86af79380..81e1f07a8482b34ea8c59f6800e7e8dec7bf56b9:/ftplugin/mkd.vim 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