Avoid considering single spaces in `detectindent` (#1595)
This commit is contained in:
parent
5d5cab1ee4
commit
954f60b5f8
|
@ -266,7 +266,7 @@ local function detect_indent_stat(doc)
|
||||||
local max_lines = auto_detect_max_lines
|
local max_lines = auto_detect_max_lines
|
||||||
for i, text in get_non_empty_lines(doc.syntax, doc.lines) do
|
for i, text in get_non_empty_lines(doc.syntax, doc.lines) do
|
||||||
local spaces = text:match("^ +")
|
local spaces = text:match("^ +")
|
||||||
if spaces then table.insert(stat, spaces:len()) end
|
if spaces and #spaces > 1 then table.insert(stat, #spaces) end
|
||||||
local tabs = text:match("^\t+")
|
local tabs = text:match("^\t+")
|
||||||
if tabs then tab_count = tab_count + 1 end
|
if tabs then tab_count = tab_count + 1 end
|
||||||
-- if nothing found for first lines try at least 4 more times
|
-- if nothing found for first lines try at least 4 more times
|
||||||
|
|
Loading…
Reference in New Issue