Minor performance optimization in s:guess (#33)
This commit is contained in:
parent
a17462708a
commit
62c4f26187
@ -15,10 +15,10 @@ function! s:guess(lines) abort
|
|||||||
let podcomment = 0
|
let podcomment = 0
|
||||||
let triplequote = 0
|
let triplequote = 0
|
||||||
let backtick = 0
|
let backtick = 0
|
||||||
|
let softtab = repeat(' ', 8)
|
||||||
|
|
||||||
for line in a:lines
|
for line in a:lines
|
||||||
|
if !len(line) || line =~# '^\s*$'
|
||||||
if line =~# '^\s*$'
|
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -60,7 +60,6 @@ function! s:guess(lines) abort
|
|||||||
let backtick = 1
|
let backtick = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let softtab = repeat(' ', 8)
|
|
||||||
if line =~# '^\t'
|
if line =~# '^\t'
|
||||||
let heuristics.hard += 1
|
let heuristics.hard += 1
|
||||||
elseif line =~# '^' . softtab
|
elseif line =~# '^' . softtab
|
||||||
@ -73,7 +72,6 @@ function! s:guess(lines) abort
|
|||||||
if indent > 1 && get(options, 'shiftwidth', 99) > indent
|
if indent > 1 && get(options, 'shiftwidth', 99) > indent
|
||||||
let options.shiftwidth = indent
|
let options.shiftwidth = indent
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if heuristics.hard && !heuristics.spaces
|
if heuristics.hard && !heuristics.spaces
|
||||||
|
Loading…
x
Reference in New Issue
Block a user