Skip to content

Commit 9d18930

Browse files
committed
Added a flag for ignoring spaces
Added flag g:indent_guides_enable_on_vim_startup Controls whether spaces are considered for indent calculating
1 parent 62a2fd1 commit 9d18930

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

autoload/indent_guides.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function! indent_guides#enable()
4646
let l:hard_pattern = indent_guides#indent_highlight_pattern('\t', l:column_start, s:indent_size)
4747

4848
" define the higlight patterns and add to matches list
49-
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
49+
if g:indent_guides_space_guides
50+
call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern))
51+
end
5052
call add(w:indent_guides_matches, matchadd(l:group, l:hard_pattern))
5153
endfor
5254
endfunction

doc/indent_guides.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ Default: 1. Values: between 1 and g:|indent_guides_indent_levels|.
133133
let g:indent_guides_start_level = 2
134134
<
135135

136+
------------------------------------------------------------------------------
137+
*'indent_guides_space_guides'*
138+
Use this option to control whether the plugin considers spaces as indention.
139+
140+
Default: 1. Values: 0 or 1.
141+
>
142+
let g:indent_guides_space_guides = 0
143+
<
136144
------------------------------------------------------------------------------
137145
*'indent_guides_enable_on_vim_startup'*
138146
Use this option to control whether the plugin is enabled on Vim startup.

plugin/indent_guides.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ call s:InitVariable('g:indent_guides_guide_size', 0 )
5252
call s:InitVariable('g:indent_guides_start_level', 1 )
5353
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
5454
call s:InitVariable('g:indent_guides_debug', 0 )
55+
call s:InitVariable('g:indent_guides_space_guides', 1 )
5556

5657
" Default mapping
5758
nmap <Leader>ig :IndentGuidesToggle<CR>

0 commit comments

Comments
 (0)