lib/soywiki.vim in soywiki-0.3.3 vs lib/soywiki.vim in soywiki-0.3.4

- old
+ new

@@ -125,22 +125,19 @@ end return s:link_under_cursor() endfunc func! s:follow_link_under_cursor(split) - if expand("<cWORD>>") == '' - " just switch windows - silent wincmd p - echom "Switched to last accessed window" - return - endif - if match(expand("<cWORD>>"), s:http_link_pattern) != -1 + let word = expand("<cWORD>") + if match(word, s:http_link_pattern) != -1 call s:open_href_under_cursor() return endif let link = s:link_under_cursor() if link == "" - echom "'" . expand("<cWORD>") . "' is not a wiki link" + " just switch windows + silent wincmd p + echom "'" . word . "' is not a wiki link. " . (winnr('$') > 1 ? "Switched to last accessed window." : "") return "" elseif line('.') == 1 " SPECIAL CASE " close window if winnr('$') > 1