Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #43 from danchoi/41-present_search_list_option

allow searching with list-return through copen
  • Loading branch information...
commit a90122763914dfc32f8c56c68d6608d94b071fd0 2 parents 1dc5b67 + 8fa4a19
@0robustus1 0robustus1 authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/soywiki.vim
View
12 lib/soywiki.vim
@@ -570,13 +570,16 @@ func! s:insert_divider()
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
"------------------------------------------------------------------------
@@ -682,8 +685,11 @@ func! s:global_mappings()
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()
Please sign in to comment.
Something went wrong with that request. Please try again.