Skip to content

Commit

Permalink
Ignore files from homedir and root for indent
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Sep 4, 2020
1 parent 99166bd commit b0124dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/polyglot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ function! s:detect_indent() abort
let dir = expand('%:p:h')
let level = 3
while isdirectory(dir) && dir !=# fnamemodify(dir, ':h') && level > 0
" Ignore files from homedir and root
if dir == expand('~') || dir == '/'
return
endif
for neighbor in glob(dir . '/' . pattern, 0, 1)[0:level]
" Do not consider directories above .git, .svn or .hg
if fnamemodify(neighbor, ":h:t")[0] == "."
Expand Down

0 comments on commit b0124dc

Please sign in to comment.