mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-22 09:39:31 +08:00
Option to open lists vertically (#1381)
* Add configuration option to open lists vertically * Add tests, clean up vertical list config * Vertical list option cleanup * Use is# for tests * Order properties in documentation alphabetically
This commit is contained in:
@@ -29,6 +29,7 @@ let s:global_variable_list = [
|
||||
\ 'ale_linters',
|
||||
\ 'ale_linters_explicit',
|
||||
\ 'ale_list_window_size',
|
||||
\ 'ale_list_vertical',
|
||||
\ 'ale_loclist_msg_format',
|
||||
\ 'ale_max_buffer_history_size',
|
||||
\ 'ale_max_signs',
|
||||
|
||||
@@ -97,12 +97,17 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
|
||||
let l:reset_visual_selection = l:mode is? 'v' || l:mode is# "\<c-v>"
|
||||
let l:reset_character_selection = l:mode is? 's' || l:mode is# "\<c-s>"
|
||||
|
||||
" open windows vertically instead of default horizontally
|
||||
let l:open_type = ''
|
||||
if ale#Var(a:buffer, 'list_vertical') == 1
|
||||
let l:open_type = 'vert '
|
||||
endif
|
||||
if g:ale_set_quickfix
|
||||
if !ale#list#IsQuickfixOpen()
|
||||
silent! execute 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
silent! execute l:open_type . 'copen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
endif
|
||||
elseif g:ale_set_loclist
|
||||
silent! execute 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
silent! execute l:open_type . 'lopen ' . str2nr(ale#Var(a:buffer, 'list_window_size'))
|
||||
endif
|
||||
|
||||
" If focus changed, restore it (jump to the last window).
|
||||
|
||||
Reference in New Issue
Block a user