Skip to content

Commit

Permalink
better load guard
Browse files Browse the repository at this point in the history
  • Loading branch information
h1mesuke committed Jan 8, 2012
1 parent 586b664 commit b91b650
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions plugin/alignta.vim
Expand Up @@ -28,12 +28,13 @@
" }}}
"=============================================================================

if v:version < 701 || &cp
if v:version < 701
echoerr "alignta: Vim 7.1 or later required."
finish
elseif exists('g:loaded_alignta')
elseif exists('g:loaded_alignta') && g:loaded_alignta
finish
endif
let g:loaded_alignta = 1

let s:save_cpo = &cpo
set cpo&vim
Expand All @@ -50,13 +51,13 @@ endif

command! -range -bang -nargs=* -complete=customlist,s:complete_command_option
\ Alignta <line1>,<line2>call <SID>align([<f-args>])
" NOTE: Bang is still acceptable for backward compatibility but it has no
" NOTE: Bang is still acceptable for backward compatibility, but it has no
" meaning now.

if exists(':Align') != 2
" :Align is ours, yay!
command! -range -bang -nargs=* -complete=customlist,s:complete_command_option
\ Align <line1>,<line2>Alignta <args>
\ Align <line1>,<line2>Alignta <args>
endif

function! s:complete_command_option(leader, cmdline, pos)
Expand Down Expand Up @@ -94,5 +95,3 @@ endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

let g:loaded_alignta = 1

0 comments on commit b91b650

Please sign in to comment.