Skip to content

Commit

Permalink
Expand relative path URL using host path separator
Browse files Browse the repository at this point in the history
  • Loading branch information
samjohn24 authored and alerque committed Apr 8, 2023
1 parent 5d3d1b6 commit cc82d88
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ftplugin/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,12 @@ endfunction
function! s:OpenUrlUnderCursor()
let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.'))
if l:url !=# ''
call s:VersionAwareNetrwBrowseX(l:url)
if l:url =~? 'http[s]\?:\/\/[[:alnum:]%\/_#.-]*'
"Do nothing
else
let l:url = expand(expand('%:h').'/'.l:url)
endif
call s:VersionAwareNetrwBrowseX(l:url)
else
echomsg 'The cursor is not on a link.'
endif
Expand Down

0 comments on commit cc82d88

Please sign in to comment.