Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ augroup Racer
autocmd FileType rust nmap <buffer> gx <Plug>(rust-def-vertical)
autocmd FileType rust nmap <buffer> gt <Plug>(rust-def-tab)
autocmd FileType rust nmap <buffer> <leader>gd <Plug>(rust-doc)
autocmd FileType rust nmap <buffer> <leader>gD <Plug>(rust-doc-tab)
augroup END
```
8 changes: 6 additions & 2 deletions autoload/racer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function! s:RacerSplitLine(line)
return parts
endfunction

function! racer#ShowDocumentation()
function! racer#ShowDocumentation(tab)
let winview = winsaveview() " Save the current cursor position
" Move to the end of the word for the entire token to search.
" Move one char back to avoid moving to the end of the *next* word.
Expand Down Expand Up @@ -143,7 +143,11 @@ function! racer#ShowDocumentation()
" If the __doc__ buffer is open in the current tab, jump to it
silent execute (wi+1) . 'wincmd w'
else
pedit __doc__
if a:tab
tab pedit __doc__
else
pedit __doc__
endif
wincmd P
endif

Expand Down
4 changes: 3 additions & 1 deletion ftplugin/rust_racer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ nnoremap <silent><buffer> <Plug>(rust-def-vertical)
nnoremap <silent><buffer> <Plug>(rust-def-tab)
\ :tab split<CR>:call racer#GoToDefinition()<CR>
nnoremap <silent><buffer> <Plug>(rust-doc)
\ :call racer#ShowDocumentation()<CR>
\ :call racer#ShowDocumentation(0)<CR>
nnoremap <silent><buffer> <Plug>(rust-doc-tab)
\ :call racer#ShowDocumentation(1)<CR>

setlocal omnifunc=racer#RacerComplete