File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -67,5 +67,6 @@ augroup Racer
67
67
autocmd FileType rust nmap <buffer> gx <Plug>(rust-def-vertical)
68
68
autocmd FileType rust nmap <buffer> gt <Plug>(rust-def-tab)
69
69
autocmd FileType rust nmap <buffer> <leader>gd <Plug>(rust-doc)
70
+ autocmd FileType rust nmap <buffer> <leader>gD <Plug>(rust-doc-tab)
70
71
augroup END
71
72
```
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ function! s:RacerSplitLine(line)
108
108
return parts
109
109
endfunction
110
110
111
- function ! racer#ShowDocumentation ()
111
+ function ! racer#ShowDocumentation (tab )
112
112
let winview = winsaveview () " Save the current cursor position
113
113
" Move to the end of the word for the entire token to search.
114
114
" Move one char back to avoid moving to the end of the *next* word.
@@ -143,7 +143,11 @@ function! racer#ShowDocumentation()
143
143
" If the __doc__ buffer is open in the current tab, jump to it
144
144
silent execute (wi + 1 ) . ' wincmd w'
145
145
else
146
- pedit __doc__
146
+ if a: tab
147
+ tab pedit __doc__
148
+ else
149
+ pedit __doc__
150
+ endif
147
151
wincmd P
148
152
endif
149
153
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ nnoremap <silent><buffer> <Plug>(rust-def-vertical)
15
15
nnoremap <silent> <buffer> <Plug> (rust-def-tab)
16
16
\ :tab split<CR> :call racer#GoToDefinition()<CR>
17
17
nnoremap <silent> <buffer> <Plug> (rust-doc)
18
- \ :call racer#ShowDocumentation()<CR>
18
+ \ :call racer#ShowDocumentation(0)<CR>
19
+ nnoremap <silent> <buffer> <Plug> (rust-doc-tab)
20
+ \ :call racer#ShowDocumentation(1)<CR>
19
21
20
22
setlocal omnifunc = racer#RacerComplete
You can’t perform that action at this time.
0 commit comments