Skip to content
Browse files

Loading needs somemore work, open belowright instead

Protected loading to only once
Made sure commands are defined not just in first buffer
Both of the above could probably use improvement
Open belowright instead of botright... (should make it an option)
  • Loading branch information...
1 parent 85b1190 commit 0ece157095441c7167f49797536cb0bf0163c5ef @coledarr committed with Oct 1, 2012
Showing with 11 additions and 5 deletions.
  1. +11 −5 plugin/vim-xqmarklogic.vim
View
16 plugin/vim-xqmarklogic.vim
@@ -30,25 +30,30 @@
" (db http header can be set to override hardcoded default). Best would be
" configured on a per buffer basis and maybe a default set in .vimrc
" TODO add a real help doc
+" TODO only load for xquery files
"
" Maintainer: Darren Cole <http://github.com/coledarr/vim-xqmarklogic>
-" Version: 0.3
+" Version: 0.3.2
+if exists('g:loaded_vimxqmarklogic')
+ finish
+endif
+let g:loaded_vimxqmarklogic=1
" Options
let s:curlCmd=0
let s:showDuration=1
" Toggle Options
-command -buffer XQtoggleCurlCmdAppend :execute s:toggleCurlCmdAppend()
+command XQtoggleCurlCmdAppend :execute s:toggleCurlCmdAppend()
function! s:toggleCurlCmdAppend()
if (s:curlCmd)
let s:curlCmd=0
else
let s:curlCmd=1
endif
endfunction
-command -buffer XQToggleShowDuration :execute s:toggleShowDuration()
+command XQToggleShowDuration :execute s:toggleShowDuration()
function! s:toggleShowDuration()
if (s:showDuration)
let s:showDuration=0
@@ -60,7 +65,7 @@ endfunction
" Running the Query
map <Leader>B :XQmlquery<cr>
-command -buffer XQmlquery :execute s:QueryMarkLogic(expand("%"))
+command XQmlquery :execute s:QueryMarkLogic(expand("%"))
let s:host = "localhost"
let s:uri = "http://"
@@ -77,7 +82,8 @@ function! s:QueryMarkLogic(fname)
"wincmd P
" Use a 'nofile' window
- botright new
+ "botright new
+ belowright new
setlocal buftype=nofile
setlocal filetype=xml

0 comments on commit 0ece157

Please sign in to comment.
Something went wrong with that request. Please try again.