Fix #2195 - Handle the command key being missing

This commit is contained in:
w0rp committed 2019-01-27 09:12:59 +00:00
1 parent 6e9040da75
commit 20b9dfdb4a
2 files changed
+14 -1

No files matched your search

+2 -1
View File
@@ -221,7 +221,7 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
let l:file_list = get(a:file_lookup, l:basename, [])
for l:item in l:file_list
if bufnr(l:item.file) is a:buffer
if bufnr(l:item.file) is a:buffer && has_key(l:item, 'command')
return ale#c#ParseCFlags(l:item.directory, l:item.command)
endif
endfor
@@ -234,6 +234,7 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
for l:item in l:dir_list
if ale#path#Simplify(fnamemodify(l:item.file, ':h')) is? l:dir
\&& has_key(l:item, 'command')
return ale#c#ParseCFlags(l:item.directory, l:item.command)
endif
endfor