Fix detecting indentation in some CSS

This is done by ignoring lines that don't have any
alphanumeric characters, e.g. following would be detected
as 4-spaces indentation instead of 2-spaces

.android {
    height: 404px; width: 334px;
    margin: 100px auto;
  }

https://github.com/tpope/vim-sleuth/issues/22
This commit is contained in:
Adam Stankiewicz
2020-09-04 19:02:39 +02:00
parent 556ba05cee
commit 48b4f233c5

View File

@@ -36,7 +36,7 @@ function! s:guess(lines) abort
let spaces_minus_tabs = 0
for line in a:lines
if !len(line) || line =~# '^\s*$'
if !len(line) || line =~# '^\W*$'
continue
endif