Logical test simplification in detectindent
This commit is contained in:
parent
3721ace099
commit
6e3cd41bd1
|
@ -105,13 +105,14 @@ local function update_cache(doc)
|
|||
local type, size, score = detect_indent_stat(doc)
|
||||
cache[doc] = { type = type, size = size, confirmed = (score >= adjust_threshold) }
|
||||
doc.indent_info = cache[doc]
|
||||
if score < adjust_threshold and Doc.on_text_change == doc_on_text_change then
|
||||
if score < adjust_threshold and doc_on_text_change then
|
||||
Doc.on_text_change = function(self, ...)
|
||||
doc_on_text_change(self, ...)
|
||||
update_cache(self)
|
||||
end
|
||||
elseif score >= adjust_threshold and Doc.on_text_change ~= doc_on_text_change then
|
||||
elseif score >= adjust_threshold and doc_on_text_change then
|
||||
Doc.on_text_change = doc_on_text_change
|
||||
doc_on_text_change = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue