Skip to content

Commit 0996492

Browse files
committed
Merge pull request #45 from sergey-vlasov/master
New `g:indent_guides_soft_pattern` option
2 parents a570008 + 74c8bde commit 0996492

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

autoload/indent_guides.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function! indent_guides#enable()
4747
for l:level in range(s:start_level, s:indent_levels)
4848
let l:group = 'IndentGuides' . ((l:level % 2 == 0) ? 'Even' : 'Odd')
4949
let l:column_start = (l:level - 1) * s:indent_size + 1
50-
let l:soft_pattern = indent_guides#indent_highlight_pattern('\s', l:column_start, s:guide_size)
50+
let l:soft_pattern = indent_guides#indent_highlight_pattern(g:indent_guides_soft_pattern, l:column_start, s:guide_size)
5151
let l:hard_pattern = indent_guides#indent_highlight_pattern('\t', l:column_start, s:indent_size)
5252

5353
" define the higlight patterns and add to matches list

doc/indent_guides.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ Default: 1. Values: 0 or 1.
141141
>
142142
let g:indent_guides_space_guides = 0
143143
<
144+
145+
------------------------------------------------------------------------------
146+
*'indent_guides_soft_pattern'*
147+
Use this option to explicitly specify a pattern for indentation. For example
148+
to match spaces only in the beginning of line use ' ' pattern.
149+
150+
Default: '\s'. Values: vim regexp.
151+
>
152+
let g:indent_guides_soft_pattern = ' '
153+
<
144154
------------------------------------------------------------------------------
145155
*'indent_guides_enable_on_vim_startup'*
146156
Use this option to control whether the plugin is enabled on Vim startup.

plugin/indent_guides.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ 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 )
5555
call s:InitVariable('g:indent_guides_space_guides', 1 )
56+
call s:InitVariable('g:indent_guides_soft_pattern', '\s')
57+
5658

5759
if !exists('g:indent_guides_exclude_filetypes')
5860
let g:indent_guides_exclude_filetypes = ['help']

0 commit comments

Comments
 (0)