Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all neighbors have to be readable #7

Closed
vlmarek opened this issue Oct 29, 2013 · 1 comment
Closed

Not all neighbors have to be readable #7

vlmarek opened this issue Oct 29, 2013 · 1 comment

Comments

@vlmarek
Copy link

vlmarek commented Oct 29, 2013

diff --git a/.vim/plugin/sleuth.vim b/.vim/plugin/sleuth.vim
--- a/.vim/plugin/sleuth.vim
+++ b/.vim/plugin/sleuth.vim
@@ -118,7 +118,9 @@
     for pattern in patterns
       for neighbor in split(glob(dir.'/'.pattern), "\n")
         if neighbor !=# expand('%:p')
-          call extend(options, s:guess(readfile(neighbor, '', 1024)), 'keep')
+          if (filereadable(neighbor))
+            call extend(options, s:guess(readfile(neighbor, '', 1024)), 'keep')
+          endif
         endif
         if s:apply_if_ready(options)
           return
@vlmarek
Copy link
Author

vlmarek commented Feb 21, 2014

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant