From 023ade872e69f69a42e6e37faf21285afdf8951a Mon Sep 17 00:00:00 2001 From: Bradford Larsen Date: Tue, 7 Aug 2018 16:10:36 -0400 Subject: [PATCH 1/3] Adjust the jumplist with line numbers too when opening a new file This further addresses Issue #1758. --- autoload/ale/util.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/ale/util.vim b/autoload/ale/util.vim index be37d1b5..e9b5688d 100644 --- a/autoload/ale/util.vim +++ b/autoload/ale/util.vim @@ -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 From 6f2d868bafc1ff636210a7509c86fcfed5d87d06 Mon Sep 17 00:00:00 2001 From: Bradford Larsen Date: Tue, 7 Aug 2018 16:41:12 -0400 Subject: [PATCH 2/3] Update tests in response to changes in #1797. --- test/test_go_to_definition.vader | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_go_to_definition.vader b/test/test_go_to_definition.vader index 7f0e3fcb..a4b6229f 100644 --- a/test/test_go_to_definition.vader +++ b/test/test_go_to_definition.vader @@ -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] From 8a9b28daf913eb72ca78409c4454ec7e3883e51a Mon Sep 17 00:00:00 2001 From: Bradford Larsen Date: Tue, 7 Aug 2018 16:51:23 -0400 Subject: [PATCH 3/3] Update tests in response to changes in #1797. --- test/test_go_to_definition.vader | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_go_to_definition.vader b/test/test_go_to_definition.vader index a4b6229f..53f566e9 100644 --- a/test/test_go_to_definition.vader +++ b/test/test_go_to_definition.vader @@ -111,7 +111,7 @@ Execute(Other files should be jumped to for definition responses): AssertEqual \ [ - \ 'edit +3' . 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 +3' . 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 +3' . 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 +3' . 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 +3' . 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]