Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.
Open
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 @@ -75,6 +75,7 @@ It is possible to set its maximum size (number of entries), default is 100:
| <Leader>rw | -e -r --rename | Rename symbol under cursor |
| <Leader>rv | -k -r | Find virtuals |
| <Leader>rb | N/A | Jump to previous location |
| <Leader>ro | --kind-filter -i -F | Find method in current file |

## Unite sources

Expand Down
4 changes: 4 additions & 0 deletions doc/rtags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ g:rtagsLog
*rtags-FindSubClasses*
<Leader>rc Find the subclasses of the class under the cursor.

*rtags-leader-ro*
*rtags-JumpToMethod*
<Leader>ro Find and jump to method in current file.

*rtags-commands*
5. Commands

Expand Down
11 changes: 11 additions & 0 deletions plugin/rtags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ if g:rtagsUseDefaultMappings == 1
noremap <Leader>rb :call rtags#JumpBack()<CR>
noremap <Leader>rC :call rtags#FindSuperClasses()<CR>
noremap <Leader>rc :call rtags#FindSubClasses()<CR>
noremap <Leader>ro :call rtags#JumpToMethod(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
noremap <Leader>rd :call rtags#Diagnostics()<CR>
endif

Expand Down Expand Up @@ -416,6 +417,16 @@ function! rtags#JumpTo(open_opt, ...)

endfunction

function! rtags#JumpToMethod(pattern)
let current_file = expand("%")
let args = {
\ '-a' : '',
\ '-F': a:pattern,
\ '--kind-filter': 'CXXMethod',
\ '-i': current_file }
let results = rtags#ExecuteThen(args, [[function('rtags#JumpToHandler'), { 'open_opt' : g:SAME_WINDOW }]])
endfunction

function! rtags#parseSourceLocation(string)
let [location; symbol_detail] = split(a:string, '\s\+')
let splittedLine = split(location, ':')
Expand Down