File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2643,10 +2643,20 @@ if !has_key(s:disabled_packages, 'autoindent')
2643
2643
func ! s: get_shiftwidth (indents) abort
2644
2644
let shiftwidth = 0
2645
2645
let max_count = 0
2646
+ let final_counts = {}
2646
2647
for [indent , indent_count] in items (a: indents )
2647
- if indent_count > max_count
2648
+ let indent_count * = 1.5
2649
+ for [indent2, indent2_count] in items (a: indents )
2650
+ if indent2 > indent && indent2 % indent == 0
2651
+ let indent_count += indent2_count
2652
+ endif
2653
+ endfor
2654
+ let final_counts[indent ] = indent_count
2655
+ endfor
2656
+ for [indent , final_count] in items (final_counts)
2657
+ if final_count > max_count
2648
2658
let shiftwidth = indent
2649
- let max_count = indent_count
2659
+ let max_count = final_count
2650
2660
endif
2651
2661
endfor
2652
2662
return shiftwidth
You can’t perform that action at this time.
0 commit comments