Permalink
Browse files

* Fighting with parent class jumping

  • Loading branch information...
1 parent 2082068 commit 54da9eb6707bf1f3922dbb2d9cadcdad28358cf0 @zergu committed Aug 29, 2011
Showing with 2 additions and 9 deletions.
  1. +2 −9 project-jumper.vim
View
@@ -117,16 +117,9 @@ function! JumperJump(target)
" Parent class - edit
elseif a:target == "parent"
throw "Not implemented yet"
- let l:linenum = 0
- while 1
- let l:matches = matchlist(getline(l:linenum), 'class.*extends \(.*\)')
- if (len (l:matches))
- let l:parent_name = l:matches[1]
- break
- endif
- let l:linenum += 1
- endwhile
+ let l:parent_name = system("grep -o 'extends \\w\\+' ".expand("%:p")." | sed 's/extends //' | sed 's/\\^\\@//")
+ throw "find ".l:maindir." -type f -name \"".l:parent_name.".php\""
if l:parent_name
let l:results = split(system("find ".l:maindir." -type f -name \"".l:parent_name.".php\""))
execute "edit ".l:results[s:MultipleChoice(l:results)]

0 comments on commit 54da9eb

Please sign in to comment.