Avoid considering single spaces in `detectindent` (#1595)

This commit is contained in:
Guldoman 2023-11-28 20:54:00 +01:00 committed by George Sokianos
parent dc62c59705
commit da64a99f18
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@ local function detect_indent_stat(doc)
local max_lines = auto_detect_max_lines
for i, text in get_non_empty_lines(doc.syntax, doc.lines) do
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+")
if tabs then tab_count = tab_count + 1 end
-- if nothing found for first lines try at least 4 more times