From df5d5c5adb5ff6a087e1e837aaaa25e22ba74d70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Simon=20D=C3=A9saulniers?= Date: Mon, 4 May 2015 18:05:41 -0400 Subject: [PATCH] adding VersionAwareNetrwBrowseX() function for doing right call to netrw browsex --- ftplugin/mkd.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.2