Merge pull request #1797 from bradlarsen/master

Additionally adjust the jumplist with line numbers when opening a new file
This commit is contained in:
w0rp 2018-08-07 21:57:12 +01:00 committed by GitHub
commit 1a4456cf2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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]