lib/soywiki.vim in soywiki-0.9.8.2.pre vs lib/soywiki.vim in soywiki-0.9.8.2.pre.1
- old
+ new
@@ -568,17 +568,20 @@
silent put! =divider
silent put=''
endfunc
"------------------------------------------------------------------------
" SEARCH
-func! s:wiki_search(pattern, in_this_namespace)
+func! s:wiki_search(pattern, in_this_namespace, display_list)
let pattern = (empty(a:pattern) ? @/ : a:pattern)
if a:in_this_namespace
execute printf('vimgrep/\c%s/ %s', pattern, s:page_namespace()."/*")
else
execute printf('vimgrep/\c%s/ %s', pattern, "*/*")
endif
+ if a:display_list
+ execute 'copen'
+ endif
endfunc
"------------------------------------------------------------------------
" This opens a new buffer with all the lines with just WikiLinks on them
" expanded (recursively). This is not a wiki buffer but a text buffer
@@ -680,11 +683,14 @@
command! -bar -nargs=1 -range -complete=file SWAppend :<line1>,<line2>call s:extract(<f-args>, 'append', 0)
command! -bar -nargs=1 -range -complete=file SWInsert :<line1>,<line2>call s:extract(<f-args>, 'insert', 0)
command! -bar -nargs=1 -range -complete=file SWLinkAppend :<line1>,<line2>call s:extract(<f-args>, 'append', 1)
command! -bar -nargs=1 -range -complete=file SWLinkInsert :<line1>,<line2>call s:extract(<f-args>, 'insert', 1)
- command! -bar -nargs=1 SWSearch :call s:wiki_search(<f-args>, 0)
- command! -bar -nargs=1 SWNamespaceSearch :call s:wiki_search(<f-args>, 1)
+ command! -bar -nargs=1 SWSearch :call s:wiki_search(<f-args>, 0, 0)
+ command! -bar -nargs=1 SWS SWSearch <args>
+ command! -bar -nargs=1 SWSearchList :call s:wiki_search(<f-args>, 0, 1)
+ command! -bar -nargs=1 SWSL SWSearchList <args>
+ command! -bar -nargs=1 SWNamespaceSearch :call s:wiki_search(<f-args>, 1, 0)
autocmd BufReadPost,BufNewFile,WinEnter,BufEnter,BufNew,BufAdd * call s:highlight_wikiwords()
autocmd BufReadPost,BufNewFile,WinEnter,BufEnter,BufNew,BufAdd * call s:prep_buffer()
" autocmd BufEnter * call s:prep_buffer()
endfunc