Skip to content

Commit

Permalink
Search for the project file a few directories up. Useful when the cur…
Browse files Browse the repository at this point in the history
…rent file being edited is not in the same directory as the project file
  • Loading branch information
hboon committed Jan 31, 2010
1 parent 0f164ee commit 8ae12a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ftplugin/objc_cocoa_mappings.vim
Expand Up @@ -7,6 +7,18 @@ if exists('b:cocoa_proj') || &cp || version < 700
finish
endif
let b:cocoa_proj = fnameescape(globpath(expand('<afile>:p:h'), '*.xcodeproj'))
" Search a few levels up to see if we can find the project file
if empty(b:cocoa_proj)
let b:cocoa_proj = fnameescape(globpath(expand('<afile>:p:h:h'), '*.xcodeproj'))

if empty(b:cocoa_proj)
let b:cocoa_proj = fnameescape(globpath(expand('<afile>:p:h:h:h'), '*.xcodeproj'))
if empty(b:cocoa_proj)
let b:cocoa_proj = fnameescape(globpath(expand('<afile>:p:h:h:h:h'), '*.xcodeproj'))
endif
endif
endif
let g:x = b:cocoa_proj

com! -buffer ListMethods call objc#method_list#Activate(1)
com! -buffer -nargs=? -complete=customlist,objc#method_builder#Completion BuildMethods call objc#method_builder#Build('<args>')
Expand Down

0 comments on commit 8ae12a4

Please sign in to comment.