Merge pull request #1861 from dimbleby/goto-definition-column

Fix out-by-one error in column on goto-definition
This commit is contained in:
w0rp 2018-08-28 10:11:44 +01:00 committed by w0rp
parent 3b7eb6a140
commit 26ceba0e47
No known key found for this signature in database
GPG key ID: 0FC1ECAA8C81CD83
2 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ function! ale#definition#HandleLSPResponse(conn_id, response) abort
for l:item in l:result
let l:filename = ale#path#FromURI(l:item.uri)
let l:line = l:item.range.start.line + 1
let l:column = l:item.range.start.character
let l:column = l:item.range.start.character + 1
call ale#util#Open(l:filename, l:line, l:column, l:options)
break

View file

@ -209,7 +209,7 @@ Execute(Other files should be jumped to for LSP definition responses):
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ],
\ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2]
AssertEqual [3, 8], getpos('.')[1:2]
AssertEqual {}, ale#definition#GetMap()
Execute(Locations inside the same file should be jumped to without using :edit):
@ -231,7 +231,7 @@ Execute(Locations inside the same file should be jumped to without using :edit):
\ [
\ ],
\ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2]
AssertEqual [3, 8], getpos('.')[1:2]
AssertEqual {}, ale#definition#GetMap()
Execute(Other files should be jumped to in tabs for LSP definition responses):
@ -254,7 +254,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
\ 'tabedit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ],
\ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2]
AssertEqual [3, 8], getpos('.')[1:2]
AssertEqual {}, ale#definition#GetMap()
Execute(Definition responses with lists should be handled):
@ -285,7 +285,7 @@ Execute(Definition responses with lists should be handled):
\ 'edit +3 ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ],
\ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2]
AssertEqual [3, 8], getpos('.')[1:2]
AssertEqual {}, ale#definition#GetMap()
Execute(Definition responses with null response should be handled):