Merge pull request #1797 from bradlarsen/master
Additionally adjust the jumplist with line numbers when opening a new file
This commit is contained in:
commit
1a4456cf2a
@ -88,10 +88,10 @@ endfunction
|
||||
|
||||
function! ale#util#Open(filename, line, column, options) abort
|
||||
if get(a:options, 'open_in_tab', 0)
|
||||
call ale#util#Execute('tabedit ' . fnameescape(a:filename))
|
||||
call ale#util#Execute('tabedit +' . a:line . ' ' . fnameescape(a:filename))
|
||||
elseif bufnr(a:filename) isnot bufnr('')
|
||||
" Open another file only if we need to.
|
||||
call ale#util#Execute('edit ' . fnameescape(a:filename))
|
||||
call ale#util#Execute('edit +' . a:line . ' ' . fnameescape(a:filename))
|
||||
else
|
||||
normal! m`
|
||||
endif
|
||||
|
@ -111,7 +111,7 @@ Execute(Other files should be jumped to for definition responses):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
@ -136,7 +136,7 @@ Execute(Other files should be jumped to for definition responses in tabs too):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'tabedit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
@ -206,7 +206,7 @@ Execute(Other files should be jumped to for LSP definition responses):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
@ -251,7 +251,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'tabedit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
@ -282,7 +282,7 @@ Execute(Definition responses with lists should be handled):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
|
Loading…
Reference in New Issue
Block a user