soywiki 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,11 +37,12 @@ def expand(file, mode, level=0)
37
37
  if mode == 'seamful'
38
38
  puts '.' * 10
39
39
  end
40
-
41
40
  elsif PROCESSED_FILES.include?(link)
42
41
  puts indent("#{link} [[already expanded]]", level, mode)
43
- else
42
+ elsif !File.file?(link.to_file_path)
44
43
  puts indent("#{link} [[no file found]]", level, mode)
44
+ else
45
+ puts indent("#{link}", level, mode)
45
46
  end
46
47
  else
47
48
  puts indent(line, level, mode)
@@ -27,7 +27,7 @@ end
27
27
 
28
28
 
29
29
  module Soywiki
30
- VERSION = '0.0.4'
30
+ VERSION = '0.0.5'
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
@@ -481,9 +481,9 @@ func! s:expand(seamless)
481
481
  silent! put =res
482
482
  silent! 1delete
483
483
  silent! normal 1G
484
+ call s:highlight_wikiwords()
484
485
  redraw
485
486
  echom "Expanded " . (a:seamless == 0 ? 'seamfully' : 'seamlessly') . "."
486
-
487
487
  endfunc
488
488
 
489
489
  "------------------------------------------------------------------------
@@ -518,6 +518,9 @@ func! s:global_mappings()
518
518
  command! -bar -nargs=1 -range -complete=file SWLinkInsert :<line1>,<line2>call s:extract(<f-args>, 'insert', 1)
519
519
 
520
520
  command! -bar -nargs=1 SWSearch :call s:wiki_search(<f-args>)
521
+
522
+ autocmd BufReadPost,BufNewFile,WinEnter,BufEnter,BufNew * call s:highlight_wikiwords()
523
+ autocmd BufEnter * call s:prep_buffer()
521
524
  endfunc
522
525
 
523
526
  " this checks if the buffer is a SoyWiki file (from firstline)
@@ -569,9 +572,6 @@ endfunc
569
572
 
570
573
  call s:global_mappings()
571
574
 
572
- autocmd BufReadPost,BufNewFile,WinEnter * call s:highlight_wikiwords()
573
- autocmd BufEnter * call s:prep_buffer()
574
-
575
575
  if (!isdirectory(".git"))
576
576
  call system("git init")
577
577
  echom "Created .git repository to store revisions"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi