A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sheerun/vim-polyglot/commit/6422a5a479905bf32abe7a322d1c0b0a75d4aa8c below:

Count all multiplies for given indent, fixes #592 · sheerun/vim-polyglot@6422a5a · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+12

-2

lines changed

Filter options

Expand file treeCollapse 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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4