lib/soywiki.vim in soywiki-0.0.8 vs lib/soywiki.vim in soywiki-0.0.9

- old
+ new

@@ -4,10 +4,11 @@ " This regex matches namedspaced WikiWords, top-level WikiWords, and relative " .WikiWords in a namespace let s:wiki_link_pattern = '\C\<\([a-z][[:alnum:]_]\+\.\)\?[A-Z][a-z]\+[A-Z]\w*\>\|\.[A-Z][a-z]\+[A-Z]\w*\>' +let s:http_link_pattern = 'https\?:[^ >)\]]\+' let s:rename_links_command = 'soywiki-rename ' let s:find_pages_linking_in_command = 'soywiki-pages-linking-in ' let s:expand_command = 'soywiki-expand ' let s:ls_command = 'soywiki-ls-t ' let s:search_for_link = "" @@ -491,13 +492,12 @@ endfunc "------------------------------------------------------------------------ func! s:open_href() - let pattern = 'https\?:[^ >)\]]\+' - let line = search(pattern, 'cw') - let href = matchstr(getline(line('.')), pattern) + let line = search(s:http_link_pattern, 'cw') + let href = matchstr(getline(line('.')), s:http_link_pattern) let command = g:SoyWiki#browser_command . " '" . href . "' " call system(command) echom command endfunc @@ -568,14 +568,16 @@ augroup END endif endfunc func! s:highlight_wikiwords() - if (s:is_wiki_page()) - exe "match Comment /". s:wiki_link_pattern. "/" - else - match none " not sure if this works + if (s:is_wiki_page()) + " exe ":match Constant /". s:http_link_pattern . "/" + "exe ":2match Comment /". s:wiki_link_pattern. "/" + syntax clear + exe "syn match Comment /". s:wiki_link_pattern. "/" + exe "syn match Constant /". s:http_link_pattern . "/" endif endfunc call s:global_mappings() @@ -601,7 +603,7 @@ else call s:load_page(bufname("%"), 0) endif call s:get_page_list() -syntax on +syntax enable let mapleader = ','