Skip to content
Browse files

Merge branch 'amerlyq-feature_showtab_switch'

* amerlyq-feature_showtab_switch:
  Update help file
  Formatting
  Added symmetrical option to disable indents for tab
2 parents 705c5fd + 930eba1 commit 018298ead9d3aa9cd3b4ae222f81022a33978b09 @nathanaelkane committed Apr 17, 2016
Showing with 17 additions and 3 deletions.
  1. +5 −3 autoload/indent_guides.vim
  2. +11 −0 doc/indent_guides.txt
  3. +1 −0 plugin/indent_guides.vim
View
8 autoload/indent_guides.vim
@@ -47,14 +47,16 @@ 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
View
11 doc/indent_guides.txt
@@ -143,6 +143,15 @@ Default: 1. Values: 0 or 1.
<
------------------------------------------------------------------------------
+ *'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
example to match spaces only in the beginning of line use ' ' pattern.
@@ -263,6 +272,8 @@ Bug reports, feedback, suggestions etc are welcomed.
* Set size of indent guide to `tabstop` value when `shiftwidth=0` or
`noexpandtab` is used (thanks @darkfeline and @wilywampa).
* Don't load plugin in unsupported versions of Vim (thanks @dersaidin).
+ * Added option g:|indent_guides_tab_guides| to control whether tabs are
+ considered as indention (thanks @amerlyq).
1.7~
* Added way to override the default mapping (thanks @xuhdev).
View
1 plugin/indent_guides.vim
@@ -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)

1 comment on commit 018298e

@guanjianzhe

I desire this feature for a long time:let g:indent_guides_tab_guides = 0.

I have verified, and felt good

Please sign in to comment.
Something went wrong with that request. Please try again.