soywiki 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/soywiki.rb +1 -1
  2. data/lib/soywiki.vim +10 -8
  3. metadata +2 -2
data/lib/soywiki.rb CHANGED
@@ -27,7 +27,7 @@ end
27
27
 
28
28
 
29
29
  module Soywiki
30
- VERSION = '0.0.8'
30
+ VERSION = '0.0.9'
31
31
  WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b|\.[A-Z][a-z]+[A-Z]\w*\b/
32
32
 
33
33
  def self.run
data/lib/soywiki.vim CHANGED
@@ -6,6 +6,7 @@
6
6
  " .WikiWords in a namespace
7
7
  let s:wiki_link_pattern = '\C\<\([a-z][[:alnum:]_]\+\.\)\?[A-Z][a-z]\+[A-Z]\w*\>\|\.[A-Z][a-z]\+[A-Z]\w*\>'
8
8
 
9
+ let s:http_link_pattern = 'https\?:[^ >)\]]\+'
9
10
  let s:rename_links_command = 'soywiki-rename '
10
11
  let s:find_pages_linking_in_command = 'soywiki-pages-linking-in '
11
12
  let s:expand_command = 'soywiki-expand '
@@ -493,9 +494,8 @@ endfunc
493
494
  "------------------------------------------------------------------------
494
495
 
495
496
  func! s:open_href()
496
- let pattern = 'https\?:[^ >)\]]\+'
497
- let line = search(pattern, 'cw')
498
- let href = matchstr(getline(line('.')), pattern)
497
+ let line = search(s:http_link_pattern, 'cw')
498
+ let href = matchstr(getline(line('.')), s:http_link_pattern)
499
499
  let command = g:SoyWiki#browser_command . " '" . href . "' "
500
500
  call system(command)
501
501
  echom command
@@ -570,10 +570,12 @@ func! s:prep_buffer()
570
570
  endfunc
571
571
 
572
572
  func! s:highlight_wikiwords()
573
- if (s:is_wiki_page())
574
- exe "match Comment /". s:wiki_link_pattern. "/"
575
- else
576
- match none " not sure if this works
573
+ if (s:is_wiki_page())
574
+ " exe ":match Constant /". s:http_link_pattern . "/"
575
+ "exe ":2match Comment /". s:wiki_link_pattern. "/"
576
+ syntax clear
577
+ exe "syn match Comment /". s:wiki_link_pattern. "/"
578
+ exe "syn match Constant /". s:http_link_pattern . "/"
577
579
  endif
578
580
  endfunc
579
581
 
@@ -603,5 +605,5 @@ else
603
605
  endif
604
606
 
605
607
  call s:get_page_list()
606
- syntax on
608
+ syntax enable
607
609
  let mapleader = ','
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi