Skip to content

Commit

Permalink
get maker_name via list
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Feb 6, 2020
1 parent d33a10f commit 911b87c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 6 additions & 2 deletions autoload/neomake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,9 @@ function! neomake#get_nearest_error() abort
\ get(get(w:, '_neomake_info', {}), 'loclist', {})]
if !empty(qfloclist) && !empty(qfloclist.entries)
call qfloclist._update_locations()
let ln_errors += filter(copy(qfloclist.entries), 'v:val.bufnr == buf && v:val.lnum == ln')
let ln_errors += map(
\ filter(copy(qfloclist.entries), 'v:val.bufnr == buf && v:val.lnum == ln'),
\ 'extend(v:val, {"list": qfloclist}, "error")')
endif
endfor

Expand All @@ -2449,7 +2451,9 @@ function! neomake#get_nearest_error() abort
if len(ln_errors) > 1
call sort(ln_errors, function('neomake#utils#sort_by_col'))
endif
return ln_errors[0]
let entry = ln_errors[0]
let entry.maker_name = entry.list.maker_info_by_jobid[entry.job_id].name
return entry
endfunction

function! neomake#GetCurrentErrorMsg() abort
Expand Down
5 changes: 1 addition & 4 deletions autoload/neomake/list.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ function! s:base_list.add_entries(entries, ...) dict abort
if a:0 && !has_key(self.job_entries, a:1.id)
let self.job_entries[a:1.id] = []
let self.maker_info_by_jobid[a:1.id] = a:1.maker
let maker_name = a:1.maker.name
else
let maker_name = ''
endif
for entry in a:entries
let idx += 1
let e = extend(copy(entry), {'nmqfidx': idx, 'maker_name': maker_name})
let e = extend(copy(entry), {'nmqfidx': idx})
if a:0
call add(self.job_entries[a:1.id], e)
let e.job_id = a:1.id
Expand Down

0 comments on commit 911b87c

Please sign in to comment.