Merge pull request #1789 from danielwe/master

Fix bug introduced in #1788: Don't use the read-only `count` as local variable
This commit is contained in:
Christian Brabandt 2018-09-10 09:52:34 +02:00 committed by GitHub
commit da8035d8a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,21 +65,21 @@ function! airline#extensions#languageclient#get(type)
let is_err = a:type == s:severity_error let is_err = a:type == s:severity_error
let symbol = is_err ? s:error_symbol : s:warning_symbol let symbol = is_err ? s:error_symbol : s:warning_symbol
let count = 0 let cnt = 0
for d in s:diagnostics_for_buffer() for d in s:diagnostics_for_buffer()
if d.severity == a:type if d.severity == a:type
let count += 1 let cnt += 1
endif endif
endfor endfor
if count == 0 if cnt == 0
return '' return ''
endif endif
if s:show_line_numbers == 1 if s:show_line_numbers == 1
return s:airline_languageclient_count(count, symbol) . <sid>airline_languageclient_get_line_number(a:type) return s:airline_languageclient_count(cnt, symbol) . <sid>airline_languageclient_get_line_number(a:type)
else else
return s:airline_languageclient_count(count, symbol) return s:airline_languageclient_count(cnt, symbol)
endif endif
endfunction endfunction