Skip to content

Commit 42d0cf9

Browse files
committed
Fix issue with opening fugitive diff
For certain files invoking :Gdiff cauesed error - could not read file .ruby-version in .git directory. Now it checks if the file is readable before trying to read it.
1 parent 37ab220 commit 42d0cf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ftplugin/ruby.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ endfunction
102102

103103
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
104104
let s:version_file = findfile('.ruby-version', '.;')
105-
if !empty(s:version_file)
105+
if !empty(s:version_file) && filereadable(s:version_file)
106106
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
107107
if !has_key(g:ruby_version_paths, b:ruby_version)
108108
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))

0 commit comments

Comments
 (0)