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')
26432643 func ! s: get_shiftwidth (indents) abort
26442644 let shiftwidth = 0
26452645 let max_count = 0
2646+ let final_counts = {}
26462647 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
26482658 let shiftwidth = indent
2649- let max_count = indent_count
2659+ let max_count = final_count
26502660 endif
26512661 endfor
26522662 return shiftwidth
You can’t perform that action at this time.
0 commit comments