Skip to content

Commit

Permalink
Merge pull request #209 from sim590/version-aware-netrw-browsex-call
Browse files Browse the repository at this point in the history
Version aware netrw browseX call
  • Loading branch information
cirosantilli committed May 5, 2015
2 parents 7573005 + df5d5c5 commit d12befd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ftplugin/mkd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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('<Plug>' . a:rhs)
execute 'nmap <buffer>' . a:lhs . ' <Plug>' . a:rhs
Expand Down

0 comments on commit d12befd

Please sign in to comment.