X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/df9dab8972c83f198aa05e166acd46e59ec4bd80..e5af33f813cf0f26e7a125eb734c5f4a9597306e:/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