summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-09 18:02:38 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-09 18:02:38 +0200
commit2369cd5d2290c97b69a540dd88222a4ddcb1fe14 (patch)
treee35d45c59567cfc181cd890bdf60094616392477
parent46affb6153698d9b5678fdb59b5921ffd53aff13 (diff)
downloadvim-polyglot-2369cd5d2290c97b69a540dd88222a4ddcb1fe14.tar.gz
vim-polyglot-2369cd5d2290c97b69a540dd88222a4ddcb1fe14.zip
Make b:sleuth_culprit more readable
-rw-r--r--ftdetect/polyglot.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 37a2525e..f44a1959 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -1799,8 +1799,10 @@ if !has_key(s:disabled_packages, 'autoindent')
let heredoc = ''
let minindent = 10
let spaces_minus_tabs = 0
+ let i = 1
for line in a:lines
+ let i += 1
if !len(line) || line =~# '^\W*$'
continue
endif
@@ -1874,7 +1876,7 @@ if !has_key(s:disabled_packages, 'autoindent')
let indent = len(matchstr(line, '^ *'))
if (indent % 2 == 0 || indent % 3 == 0) && indent < minindent
let minindent = indent
- let b:sleuth_culprit .= ":" . line
+ let b:sleuth_culprit .= ':' . i
endif
endif
endfor