mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Fix #1661 - Do not use :edit when jumping inside of a file
This commit is contained in:
@@ -187,6 +187,28 @@ Execute(Other files should be jumped to for LSP definition responses):
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
AssertEqual {}, ale#definition#GetMap()
|
||||
|
||||
Execute(Locations inside the same file should be jumped to without using :edit):
|
||||
call ale#definition#SetMap({3: {'open_in_tab': 0}})
|
||||
call ale#definition#HandleLSPResponse(
|
||||
\ 1,
|
||||
\ {
|
||||
\ 'id': 3,
|
||||
\ 'result': {
|
||||
\ 'uri': ale#path#ToURI(ale#path#Simplify(expand('%:p'))),
|
||||
\ 'range': {
|
||||
\ 'start': {'line': 2, 'character': 7},
|
||||
\ },
|
||||
\ },
|
||||
\ }
|
||||
\)
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ ],
|
||||
\ g:expr_list
|
||||
AssertEqual [3, 7], getpos('.')[1:2]
|
||||
AssertEqual {}, ale#definition#GetMap()
|
||||
|
||||
Execute(Other files should be jumped to in tabs for LSP definition responses):
|
||||
call ale#definition#SetMap({3: {'open_in_tab': 1}})
|
||||
call ale#definition#HandleLSPResponse(
|
||||
|
||||
Reference in New Issue
Block a user