Skip to content

Commit

Permalink
Merge pull request #123 from baskerville/tagstack
Browse files Browse the repository at this point in the history
Update the tag stack when jumping to a definition
  • Loading branch information
Shougo authored Feb 7, 2019
2 parents 9c0a05e + 6fe615e commit f086056
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions autoload/racer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,25 @@ function! racer#GoToDefinition()
let linenum = split(line[6:], ',')[1]
let colnum = split(line[6:], ',')[2]
let fname = split(line[6:], ',')[3]
let dotag = &tagstack && exists('*gettagstack') && exists('*settagstack')
if dotag
let from = [bufnr('%'), line('.'), col('.'), 0]
let tagname = expand('<cword>')
let stack = gettagstack()
if stack.curidx > 1
let stack.items = stack.items[0:stack.curidx-2]
else
let stack.items = []
endif
let stack.items += [{'from': from, 'tagname': tagname}]
let stack.curidx = len(stack.items)
call settagstack(win_getid(), stack)
endif
call s:RacerJumpToLocation(fname, linenum, colnum)
if dotag
let curidx = gettagstack().curidx + 1
call settagstack(win_getid(), {'curidx': curidx})
endif
break
endif
endfor
Expand Down

0 comments on commit f086056

Please sign in to comment.