Skip to content

Commit cc82d88

Browse files
samjohn24alerque
authored andcommitted
Expand relative path URL using host path separator
1 parent 5d3d1b6 commit cc82d88

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ftplugin/markdown.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,12 @@ endfunction
656656
function! s:OpenUrlUnderCursor()
657657
let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.'))
658658
if l:url !=# ''
659-
call s:VersionAwareNetrwBrowseX(l:url)
659+
if l:url =~? 'http[s]\?:\/\/[[:alnum:]%\/_#.-]*'
660+
"Do nothing
661+
else
662+
let l:url = expand(expand('%:h').'/'.l:url)
663+
endif
664+
call s:VersionAwareNetrwBrowseX(l:url)
660665
else
661666
echomsg 'The cursor is not on a link.'
662667
endif

0 commit comments

Comments
 (0)