From 7aac8169ea670c755b99baea6f08503d6dfef517 Mon Sep 17 00:00:00 2001 From: Allen Li Date: Sun, 16 Feb 2014 21:07:37 -0500 Subject: [PATCH 1/3] Set size of indent guide to `tabstop` value when `shiftwidth=0` is used Fixes #57 --- autoload/indent_guides.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index 95a9552..9bc95fa 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -180,7 +180,11 @@ endfunction " plugin is enabled. " function! indent_guides#init_script_vars() - let s:indent_size = &l:shiftwidth + if &l:shiftwidth > 0 + let s:indent_size = &l:shiftwidth + else + let s:indent_size = &l:tabstop + endif let s:guide_size = indent_guides#calculate_guide_size() let s:hi_normal = indent_guides#capture_highlight('Normal') From 4228b349f14d70f05f7de00eb9911305550d99e9 Mon Sep 17 00:00:00 2001 From: Nate Kane Date: Sun, 22 Mar 2015 21:23:29 +1000 Subject: [PATCH 2/3] Add file for testing when `shiftwidth=0` is used --- test-files/test-ts2sw0et.txt | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test-files/test-ts2sw0et.txt diff --git a/test-files/test-ts2sw0et.txt b/test-files/test-ts2sw0et.txt new file mode 100644 index 0000000..75899c1 --- /dev/null +++ b/test-files/test-ts2sw0et.txt @@ -0,0 +1,47 @@ +vim:tw=78:ts=2:sw=0:et:nolist + +test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + +test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test + test From f4213240a372485ed44ddee84311e0f7f1125ab3 Mon Sep 17 00:00:00 2001 From: Nate Kane Date: Sun, 22 Mar 2015 21:33:41 +1000 Subject: [PATCH 3/3] Update help file --- doc/indent_guides.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/indent_guides.txt b/doc/indent_guides.txt index 714e632..ba635af 100644 --- a/doc/indent_guides.txt +++ b/doc/indent_guides.txt @@ -260,6 +260,8 @@ Bug reports, feedback, suggestions etc are welcomed. soft indentation (thanks @sergey-vlasov). * Added option g:|indent_guides_default_mapping| to control whether the default mapping (ig) gets set (thanks @suy). + * Set size of indent guide to `tabstop` value when `shiftwidth=0` is used + (thanks @darkfeline). 1.7~ * Added way to override the default mapping (thanks @xuhdev).