Added a flag for ignoring spaces

Added flag g:indent_guides_enable_on_vim_startup
Controls whether spaces are considered for indent calculating
This commit is contained in:
Ryan Souza 2011-07-31 18:11:04 -07:00
parent 62a2fd103f
commit 9d189306aa
3 changed files with 12 additions and 1 deletions

View File

@ -46,7 +46,9 @@ function! indent_guides#enable()
let l:hard_pattern = indent_guides#indent_highlight_pattern('\t', l:column_start, s:indent_size)
" define the higlight patterns and add to matches list
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
if g:indent_guides_space_guides
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
end
call add(w:indent_guides_matches, matchadd(l:group, l:hard_pattern))
endfor
endfunction

View File

@ -133,6 +133,14 @@ Default: 1. Values: between 1 and g:|indent_guides_indent_levels|.
let g:indent_guides_start_level = 2
<
------------------------------------------------------------------------------
*'indent_guides_space_guides'*
Use this option to control whether the plugin considers spaces as indention.
Default: 1. Values: 0 or 1.
>
let g:indent_guides_space_guides = 0
<
------------------------------------------------------------------------------
*'indent_guides_enable_on_vim_startup'*
Use this option to control whether the plugin is enabled on Vim startup.

View File

@ -52,6 +52,7 @@ call s:InitVariable('g:indent_guides_guide_size', 0 )
call s:InitVariable('g:indent_guides_start_level', 1 )
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
call s:InitVariable('g:indent_guides_debug', 0 )
call s:InitVariable('g:indent_guides_space_guides', 1 )
" Default mapping
nmap <Leader>ig :IndentGuidesToggle<CR>