From fdcdd20b0079f1dbdef9578ef8a8027932a9124d Mon Sep 17 00:00:00 2001 From: Sheldon Jones Date: Sun, 5 Jan 2014 15:10:35 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20issue=2061=20https://github.com/nathanael?= =?UTF-8?q?kane/vim-indent-guides/issues/61=20=E2=80=94=20make=20g:indent?= =?UTF-8?q?=5Fguides=5Fautocmds=5Fenabled=20a=20buffer=20variable=20?= =?UTF-8?q?=E2=80=94=20this=20allows=20file=20type=20auto=20commands=20lik?= =?UTF-8?q?e=20(autocmd=20FileType=20python=20IndentGuidesEnable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/indent_guides.vim | 6 +++--- plugin/indent_guides.vim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index 95a9552..b39f4b4 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -19,7 +19,7 @@ endfunction " other buffers and windows. " function! indent_guides#process_autocmds() - if g:indent_guides_autocmds_enabled + if exists('b:indent_guides_autocmds_enabled') && b:indent_guides_autocmds_enabled call indent_guides#enable() else call indent_guides#disable() @@ -31,7 +31,7 @@ endfunction " entering it. " function! indent_guides#enable() - let g:indent_guides_autocmds_enabled = 1 + let b:indent_guides_autocmds_enabled = 1 if &diff || indent_guides#exclude_filetype() call indent_guides#clear_matches() @@ -63,7 +63,7 @@ endfunction " entering it. " function! indent_guides#disable() - let g:indent_guides_autocmds_enabled = 0 + let b:indent_guides_autocmds_enabled = 0 call indent_guides#clear_matches() endfunction diff --git a/plugin/indent_guides.vim b/plugin/indent_guides.vim index 7fbc41e..f8b9aa7 100644 --- a/plugin/indent_guides.vim +++ b/plugin/indent_guides.vim @@ -39,7 +39,7 @@ function s:InitVariable(var, value) endfunction " Fixed global variables -let g:indent_guides_autocmds_enabled = 0 +let b:indent_guides_autocmds_enabled = 0 let g:indent_guides_color_hex_pattern = '#[0-9A-Fa-f]\{6\}' let g:indent_guides_color_hex_guibg_pattern = 'guibg=\zs' . g:indent_guides_color_hex_pattern . '\ze' let g:indent_guides_color_name_guibg_pattern = "guibg='\\?\\zs[0-9A-Za-z ]\\+\\ze'\\?"