mirror of
https://github.com/preservim/vim-indent-guides.git
synced 2025-11-12 20:03:46 -05:00
Add option g:indent_guides_exclude_filetypes.
For specifying a list of filetypes to disable the plugin for. Closes #20 and #26.
This commit is contained in:
@@ -33,6 +33,11 @@ endfunction
|
||||
function! indent_guides#enable()
|
||||
let g:indent_guides_autocmds_enabled = 1
|
||||
|
||||
if indent_guides#exclude_filetype()
|
||||
call indent_guides#clear_matches()
|
||||
return
|
||||
end
|
||||
|
||||
call indent_guides#init_script_vars()
|
||||
call indent_guides#highlight_colors()
|
||||
call indent_guides#clear_matches()
|
||||
@@ -261,3 +266,15 @@ function! indent_guides#indent_highlight_pattern(indent_pattern, column_start, i
|
||||
let l:pattern .= '\ze'
|
||||
return l:pattern
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Detect if any of the buffer filetypes should be excluded.
|
||||
"
|
||||
function! indent_guides#exclude_filetype()
|
||||
for ft in split(&ft, ',')
|
||||
if index(g:indent_guides_exclude_filetypes, ft) > -1
|
||||
return 1
|
||||
end
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user