Skip to content

Commit

Permalink
Add vertical lists
Browse files Browse the repository at this point in the history
Resolve neomake#2490
  • Loading branch information
nomasprime committed Jun 1, 2020
1 parent d10e539 commit e0d1f24
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
21 changes: 15 additions & 6 deletions autoload/neomake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,20 @@ function! s:HandleLoclistQflistDisplay(jobinfo, loc_or_qflist, ...) abort
if !open_val
return
endif
let height = neomake#utils#GetSetting('list_height', a:jobinfo.maker, 10, a:jobinfo.ft, a:jobinfo.bufnr)
if !height
return
let vert = neomake#utils#GetSetting('list_vert', a:jobinfo.maker, 0, a:jobinfo.ft, a:jobinfo.bufnr)
if vert
let vert = 'vert '
let height = neomake#utils#GetSetting('list_height', a:jobinfo.maker, 50, a:jobinfo.ft, a:jobinfo.bufnr)
let height = float2nr(floor((&columns / 100.0) * height))
else
let vert = ''
let height = neomake#utils#GetSetting('list_height', a:jobinfo.maker, 10, a:jobinfo.ft, a:jobinfo.bufnr)
" TODO Is this needed? Thought would always be set with the default
if !height
return
endif
let height = min([len(a:loc_or_qflist), height])
endif
let height = min([len(a:loc_or_qflist), height])
if a:jobinfo.file_mode
call neomake#log#debug('Handling location list: executing lwindow.', a:jobinfo)
let cmd = 'lwindow'
Expand All @@ -1000,7 +1009,7 @@ function! s:HandleLoclistQflistDisplay(jobinfo, loc_or_qflist, ...) abort
call neomake#compat#save_prev_windows()

let win_count = winnr('$')
exe cmd height
exe vert cmd height
let new_win_count = winnr('$')
if win_count == new_win_count
" No new window, adjust height eventually.
Expand Down Expand Up @@ -1049,7 +1058,7 @@ function! s:HandleLoclistQflistDisplay(jobinfo, loc_or_qflist, ...) abort
let g:neomake#core#_ignore_autocommands -= 1
endtry
else
exe cmd height
exe vert cmd height
endif
endfunction

Expand Down
13 changes: 10 additions & 3 deletions doc/neomake.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*neomake.txt* - asynchronous make for Vim version 7.4+ and Neovim


███╗ ██╗███████╗ ██████╗ ███╗ ███╗ █████╗ ██╗ ██╗███████╗
████╗ ██║██╔════╝██╔═══██╗████╗ ████║██╔══██╗██║ ██╔╝██╔════╝
██╔██╗ ██║█████╗ ██║ ██║██╔████╔██║███████║█████╔╝ █████╗
Expand Down Expand Up @@ -570,9 +571,15 @@ opened. Defaults to 0.

*g:neomake_list_height*
*b:neomake_list_height*
The maximum height of the |location-list| or |quickfix| list window opened by
Neomake. If there are fewer entries it will use that instead.
Defaults to 10.
The maximum line height of the |location-list| or |quickfix| list window
opened by Neomake. If there are fewer entries, it will use that instead. If
|g:neomake_list_vert| or |b:neomake_list_vert| is true, it becomes a
percentage of the screen columns. Defaults to 10 or 50 respectively.

*g:neomake_list_vert*
*b:neomake_list_vert*
Whether to open the |location-list| or |quickfix| list window with the |:vert|
modifier. Defaults to 0.

*g:neomake_echo_current_error*
This setting will |:echo| the error for the line your cursor is on, if any.
Expand Down

0 comments on commit e0d1f24

Please sign in to comment.