summaryrefslogtreecommitdiffstats
path: root/runtime/autoload
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-25 22:13:59 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-25 22:13:59 +0000
commit551dbcc9b604c2992f908fb475e797fcc116315b (patch)
treed48db26e4f3470df23fdd8e8593bcf067fab4142 /runtime/autoload
parentf9393ef5efde2f425fbd9e19363186f8c9103376 (diff)
updated for version 7.0f01v7.0f01
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/rubycomplete.vim27
-rw-r--r--runtime/autoload/vimball.vim32
2 files changed, 50 insertions, 9 deletions
diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim
index d1c8a26538..53dc869d6b 100644
--- a/runtime/autoload/rubycomplete.vim
+++ b/runtime/autoload/rubycomplete.vim
@@ -90,9 +90,15 @@ function! GetRubyVarType(v)
return vtp
endif
call setpos('.',pos)
- let [lnum,lcol] = searchpos(''.a:v.'\>\s*[+\-*/]*=\s*\([^ \t]\+.\(now\|new\|open\|get_instance\)\>\|[\[{"''/]\|%r{\)','nb',stopline)
+ if g:rubycomplete_rails == 1 && g:rubycomplete_rails_loaded == 1
+ let ctors = '\(now\|new\|open\|get_instance\|find\|create\)'
+ else
+ let ctors = '\(now\|new\|open\|get_instance\)'
+ endif
+
+ let [lnum,lcol] = searchpos(''.a:v.'\>\s*[+\-*/]*=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%r{\)','nb',stopline)
if lnum != 0 && lcol != 0
- let str = matchstr(getline(lnum),'=\s*\([^ \t]\+.\(now\|new\|open\|get_instance\)\>\|[\[{"''/]\|%r{\)',lcol)
+ let str = matchstr(getline(lnum),'=\s*\([^ \t]\+.' . ctors . '\>\|[\[{"''/]\|%r{\)',lcol)
let str = substitute(str,'^=\s*','','')
call setpos('.',pos)
if str == '"' || str == ''''
@@ -255,7 +261,7 @@ def load_rails()
file_name = VIM::evaluate('expand("%:t")')
path = buf_path.gsub( file_name, '' )
path.gsub!( /\\/, "/" )
- pup = [ "../", "../../", "../../../", "../../../../" ]
+ pup = [ "./", "../", "../../", "../../../", "../../../../" ]
pok = nil
pup.each do |sup|
@@ -267,10 +273,19 @@ def load_rails()
end
return if pok == nil
+
bootfile = pok + "/boot.rb"
- if File.exists?( bootfile )
- require bootfile
- VIM::evaluate('let g:rubycomplete_rails_loaded = 1')
+ envfile = pok + "/environment.rb"
+ if File.exists?( bootfile ) && File.exists?( envfile )
+ begin
+ require bootfile
+ require envfile
+ require 'console_app'
+ require 'console_with_helpers'
+ VIM::command('let g:rubycomplete_rails_loaded = 1')
+ rescue
+ print "Error loading rails environment"
+ end
end
end
diff --git a/runtime/autoload/vimball.vim b/runtime/autoload/vimball.vim
index 91c57b2eb8..61d5fa662a 100644
--- a/runtime/autoload/vimball.vim
+++ b/runtime/autoload/vimball.vim
@@ -1,7 +1,7 @@
" vimball : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
-" Date: Apr 24, 2006
-" Version: 7
+" Date: Apr 25, 2006
+" Version: 8
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
@@ -15,7 +15,7 @@ if &cp || exists("g:loaded_vimball")
finish
endif
let s:keepcpo = &cpo
-let g:loaded_vimball = "v7"
+let g:loaded_vimball = "v8"
set cpo&vim
" =====================================================================
@@ -255,6 +255,32 @@ fun! vimball#Vimball(really)
" call Dret("Vimball")
endfun
+" ---------------------------------------------------------------------
+" vimball#Decompress: attempts to automatically decompress vimballs {{{2
+fun! vimball#Decompress(fname)
+" call Dfunc("Decompress(fname<".a:fname.">)")
+
+ " decompression:
+ if expand("%") =~ '.*\.gz' && executable("gunzip")
+ exe "!gunzip ".a:fname
+ let fname= substitute(a:fname,'\.gz$','','')
+ exe "e ".fname
+ echohl WarningMsg | echo "Source this file to extract it! (:so ".fname.")" | echohl None
+ elseif expand("%") =~ '.*\.bz2' && executable("bunzip2")
+ exe "!bunzip2 ".a:fname
+ let fname= substitute(a:fname,'\.bz2$','','')
+ exe "e ".fname
+ echohl WarningMsg | echo "Source this file to extract it! (:so ".fname.")" | echohl None
+ elseif expand("%") =~ '.*\.zip' && executable("unzip")
+ exe "!unzip ".a:fname
+ let fname= substitute(a:fname,'\.zip$','','')
+ exe "e ".fname
+ echohl WarningMsg | echo "Source this file to extract it! (:so ".fname.")" | echohl None
+ endif
+
+" call Dret("Decompress")
+endfun
+
let &cpo= s:keepcpo
unlet s:keepcpo
" =====================================================================