Skip to content

Commit a397b3b

Browse files
committed
Merge branch 'darkfeline-fix-57'
* darkfeline-fix-57: Update help file Add file for testing when `shiftwidth=0` is used Set size of indent guide to `tabstop` value when `shiftwidth=0` is used
2 parents eec1b62 + f421324 commit a397b3b

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

autoload/indent_guides.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ endfunction
180180
" plugin is enabled.
181181
"
182182
function! indent_guides#init_script_vars()
183-
let s:indent_size = &l:shiftwidth
183+
if &l:shiftwidth > 0
184+
let s:indent_size = &l:shiftwidth
185+
else
186+
let s:indent_size = &l:tabstop
187+
endif
184188
let s:guide_size = indent_guides#calculate_guide_size()
185189
let s:hi_normal = indent_guides#capture_highlight('Normal')
186190

doc/indent_guides.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ Bug reports, feedback, suggestions etc are welcomed.
260260
soft indentation (thanks @sergey-vlasov).
261261
* Added option g:|indent_guides_default_mapping| to control whether the
262262
default mapping (<Leader>ig) gets set (thanks @suy).
263+
* Set size of indent guide to `tabstop` value when `shiftwidth=0` is used
264+
(thanks @darkfeline).
263265

264266
1.7~
265267
* Added way to override the default mapping (thanks @xuhdev).

test-files/test-ts2sw0et.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
vim:tw=78:ts=2:sw=0:et:nolist
2+
3+
test
4+
test
5+
test
6+
test
7+
test
8+
test
9+
test
10+
test
11+
test
12+
test
13+
test
14+
test
15+
test
16+
test
17+
test
18+
test
19+
test
20+
test
21+
test
22+
test
23+
test
24+
test
25+
26+
test
27+
test
28+
test
29+
test
30+
test
31+
test
32+
test
33+
test
34+
test
35+
test
36+
test
37+
test
38+
test
39+
test
40+
test
41+
test
42+
test
43+
test
44+
test
45+
test
46+
test
47+
test

0 commit comments

Comments
 (0)