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') 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). 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