From 9d189306aa4657c0100dae10c003aa1041092a4d Mon Sep 17 00:00:00 2001 From: Ryan Souza Date: Sun, 31 Jul 2011 18:11:04 -0700 Subject: [PATCH] Added a flag for ignoring spaces Added flag g:indent_guides_enable_on_vim_startup Controls whether spaces are considered for indent calculating --- autoload/indent_guides.vim | 4 +++- doc/indent_guides.txt | 8 ++++++++ plugin/indent_guides.vim | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index 7267cfd..e048ac0 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -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 diff --git a/doc/indent_guides.txt b/doc/indent_guides.txt index b6d0e08..579b386 100644 --- a/doc/indent_guides.txt +++ b/doc/indent_guides.txt @@ -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. diff --git a/plugin/indent_guides.vim b/plugin/indent_guides.vim index cc3c8ad..c8594c5 100644 --- a/plugin/indent_guides.vim +++ b/plugin/indent_guides.vim @@ -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 ig :IndentGuidesToggle