From 37daedafed010e7e880e88137c98b35ea0d40cd1 Mon Sep 17 00:00:00 2001 From: Tadeas Uhlir Date: Mon, 4 Feb 2019 16:50:46 -0500 Subject: [PATCH] Fix error when parsing compile_commands for c langs This little error caused that when parsing compile_commands json, the filename was used to fetch entries in directory dictionary, hence, when adding new json commands, it never found anything in dir_lookup and instead rewrote the previous entry. Hence, the dir_lookup always contained list of only one compile_command per directory instead of all compile_commands for given directory. --- autoload/ale/c.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 6ac2d398..99791261 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -202,7 +202,7 @@ function! s:GetLookupFromCompileCommandsFile(compile_commands_file) abort let l:file_lookup[l:basename] = get(l:file_lookup, l:basename, []) + [l:entry] let l:dirbasename = tolower(fnamemodify(l:entry.directory, ':p:h:t')) - let l:dir_lookup[l:dirbasename] = get(l:dir_lookup, l:basename, []) + [l:entry] + let l:dir_lookup[l:dirbasename] = get(l:dir_lookup, l:dirbasename, []) + [l:entry] endfor if !empty(l:file_lookup) && !empty(l:dir_lookup)