Closes #3019 - Implement default navigation

Default navigation for commands that jump to new locations has been
implemented with the `ale_default_navigation` variable, and all commands
that jump to locations now support `-tab`, `-split`, or `-vsplit`
arguments for overriding the default navigation behavior.
This commit is contained in:
w0rp
2020-04-15 16:50:13 +01:00
parent bbe5153fcb
commit 82f734a7c2
9 changed files with 278 additions and 113 deletions

View File

@@ -91,17 +91,17 @@ endfunction
" options['open_in'] can be:
" current-buffer (default)
" tab
" vertical-split
" horizontal-split
" split
" vsplit
function! ale#util#Open(filename, line, column, options) abort
let l:open_in = get(a:options, 'open_in', 'current-buffer')
let l:args_to_open = '+' . a:line . ' ' . fnameescape(a:filename)
if l:open_in is# 'tab'
call ale#util#Execute('tabedit ' . l:args_to_open)
elseif l:open_in is# 'horizontal-split'
elseif l:open_in is# 'split'
call ale#util#Execute('split ' . l:args_to_open)
elseif l:open_in is# 'vertical-split'
elseif l:open_in is# 'vsplit'
call ale#util#Execute('vsplit ' . l:args_to_open)
elseif bufnr(a:filename) isnot bufnr('')
" Open another file only if we need to.