Skip to content

Commit

Permalink
Merge branch 'feature_showtab_switch' of https://github.com/amerlyq/v…
Browse files Browse the repository at this point in the history
…im-indent-guides into amerlyq-feature_showtab_switch

* 'feature_showtab_switch' of https://github.com/amerlyq/vim-indent-guides:
  Added symmetrical option to disable indents for tab
  • Loading branch information
nathanaelkane committed Apr 17, 2016
2 parents 705c5fd + 470ef5e commit 67f3020
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 7 additions & 3 deletions autoload/indent_guides.vim
Expand Up @@ -47,14 +47,18 @@ function! indent_guides#enable()
for l:level in range(s:start_level, s:indent_levels)
let l:group = 'IndentGuides' . ((l:level % 2 == 0) ? 'Even' : 'Odd')
let l:column_start = (l:level - 1) * s:indent_size + 1
let l:soft_pattern = indent_guides#indent_highlight_pattern(g:indent_guides_soft_pattern, l:column_start, s:guide_size)
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
if g:indent_guides_space_guides
let l:soft_pattern = indent_guides#indent_highlight_pattern(
\ g:indent_guides_soft_pattern, l:column_start, s:guide_size)
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))
if g:indent_guides_tab_guides
let l:hard_pattern = indent_guides#indent_highlight_pattern(
\ '\t', l:column_start, s:indent_size)
call add(w:indent_guides_matches, matchadd(l:group, l:hard_pattern))
end
endfor
endfunction

Expand Down
9 changes: 9 additions & 0 deletions doc/indent_guides.txt
Expand Up @@ -142,6 +142,15 @@ Default: 1. Values: 0 or 1.
let g:indent_guides_space_guides = 0
<

------------------------------------------------------------------------------
*'indent_guides_tab_guides'*
Use this option to control whether the plugin considers tabs as indention.

Default: 1. Values: 0 or 1.
>
let g:indent_guides_tab_guides = 0
------------------------------------------------------------------------------
*'indent_guides_soft_pattern'*
Use this option to explicitly specify a pattern for soft indentation. For
Expand Down
1 change: 1 addition & 0 deletions plugin/indent_guides.vim
Expand Up @@ -58,6 +58,7 @@ 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)
call s:InitVariable('g:indent_guides_tab_guides', 1)
call s:InitVariable('g:indent_guides_soft_pattern', '\s')
call s:InitVariable('g:indent_guides_default_mapping', 1)

Expand Down

0 comments on commit 67f3020

Please sign in to comment.