Skip to content

Commit

Permalink
Fixed taggatron_enabled issue highlighted by @perrin4869
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Konstantinov committed Feb 23, 2014
1 parent 02f12f1 commit 571678f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 2 additions & 11 deletions autoload/taggatron.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ if exists("g:loaded_taggatron") || &cp
endif
let g:loaded_taggatron= 1

" Initialise script default values
let s:taggatron_enabled = 1
let s:tagcommands = {}
let s:tagcommands_entry = {
\ "cmd": "ctags-exuberant",
\ "args": "",
\ "filesappend": "**"
\ }

""
" Check command options and initialise tag creation.
"
Expand Down Expand Up @@ -77,13 +68,13 @@ endfunction
function! taggatron#CreateTags(cmdset, forceCreate)
call taggatron#debug('Creating tags for file type ' . &filetype)
call taggatron#debug('Argument: ' . string(a:cmdset))
call taggatron#debug('Default: ' . string(s:tagcommands_entry))
call taggatron#debug('Default: ' . string(taggatron#get('tagcommand_defaults')))

" Initialise local support variables
let l:cmdset = {}

" Build up a set of command line options
call extend(l:cmdset, s:tagcommands_entry)
call extend(l:cmdset, taggatron#get('tagcommand_defaults'))
call extend(l:cmdset, a:cmdset)

" Updated tag file and exit early
Expand Down
13 changes: 10 additions & 3 deletions plugin/taggatron.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
" Initialise script default values
let s:taggatron_enabled = 1
let s:taggatron_verbose = 0
let s:tagdefaults = ''
let s:tagcommands = {}
let s:tagcommand_defaults = {
\ "cmd": "ctags-exuberant",
\ "args": "",
\ "filesappend": "**"
\ }

" Function Declarations
" =====================
Expand Down Expand Up @@ -74,8 +81,8 @@ endfunction
"
function! taggatron#get(option, ...)
for l:scope in ['b', 'g', 'l', 's']
if exists(l:scope . ':'. a:option)
return eval(l:scope . ':'. a:option)
if exists(l:scope . ':' . a:option)
return eval(l:scope . ':' . a:option)
endif
endfor

Expand Down Expand Up @@ -119,7 +126,7 @@ endfunction
" ===============

" Initialise taggatron auto-commands
autocmd! BufNew,BufRead * call taggatron#SetTags(taggatron#get('tagdefaults', []))
autocmd! BufNew,BufRead * call taggatron#SetTags(taggatron#get('tagdefaults'))
autocmd! BufWritePost * call taggatron#CheckCommandList(0)

" Initialise taggatron commands
Expand Down

0 comments on commit 571678f

Please sign in to comment.