Skip to content

Commit 9bb546e

Browse files
authored
Merge pull request parsonsmatt#158 from bradlarsen/master
More carefully adjust jumplist in InterGoToDef
2 parents 51999e8 + 95f6ce7 commit 9bb546e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autoload/intero/loc.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ function! s:handle_loc(resp) abort
7070
let l:start_row = l:start_split[0]
7171
let l:start_col = l:start_split[1]
7272
let l:cwd = getcwd()
73+
" jump to the appropriate location, taking care to add exactly one
74+
" entry to the jumplist
7375
if l:pack_or_path != l:cwd . '/' . expand('%')
74-
exec 'edit +' . l:start_row . ' ' . l:pack_or_path
76+
exec 'edit ' . l:pack_or_path
77+
call cursor(l:start_row, l:start_col)
78+
else
79+
exec 'normal ' . l:start_row . 'G' . l:start_col . '|'
7580
endif
76-
call cursor(l:start_row, l:start_col)
7781
exec 'cd ' . l:cwd
7882
endif
7983
endfunction

0 commit comments

Comments
 (0)