File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -67,5 +67,6 @@ augroup Racer
6767 autocmd FileType rust nmap <buffer> gx <Plug>(rust-def-vertical)
6868 autocmd FileType rust nmap <buffer> gt <Plug>(rust-def-tab)
6969 autocmd FileType rust nmap <buffer> <leader>gd <Plug>(rust-doc)
70+ autocmd FileType rust nmap <buffer> <leader>gD <Plug>(rust-doc-tab)
7071augroup END
7172```
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ function! s:RacerSplitLine(line)
108108 return parts
109109endfunction
110110
111- function ! racer#ShowDocumentation ()
111+ function ! racer#ShowDocumentation (tab )
112112 let winview = winsaveview () " Save the current cursor position
113113 " Move to the end of the word for the entire token to search.
114114 " Move one char back to avoid moving to the end of the *next* word.
@@ -143,7 +143,11 @@ function! racer#ShowDocumentation()
143143 " If the __doc__ buffer is open in the current tab, jump to it
144144 silent execute (wi + 1 ) . ' wincmd w'
145145 else
146- pedit __doc__
146+ if a: tab
147+ tab pedit __doc__
148+ else
149+ pedit __doc__
150+ endif
147151 wincmd P
148152 endif
149153
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ nnoremap <silent><buffer> <Plug>(rust-def-vertical)
1515nnoremap <silent> <buffer> <Plug> (rust-def-tab)
1616 \ :tab split<CR> :call racer#GoToDefinition()<CR>
1717nnoremap <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>
1921
2022setlocal omnifunc = racer#RacerComplete
You can’t perform that action at this time.
0 commit comments