From ec7944aaf2d5fd67b7bd59a69d6a393424b6c8f8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 12 Jun 2013 21:29:15 +0200 Subject: Update runtime files. --- runtime/autoload/rubycomplete.vim | 47 +-- runtime/compiler/eruby.vim | 4 +- runtime/compiler/rake.vim | 35 ++ runtime/compiler/rspec.vim | 22 +- runtime/compiler/ruby.vim | 27 +- runtime/compiler/rubyunit.vim | 4 +- runtime/compiler/xmllint.vim | 11 +- runtime/doc/eval.txt | 5 +- runtime/doc/gui.txt | 2 +- runtime/doc/indent.txt | 46 ++- runtime/doc/insert.txt | 51 ++- runtime/doc/map.txt | 15 +- runtime/doc/options.txt | 4 +- runtime/doc/starting.txt | 37 ++- runtime/doc/tags | 17 + runtime/doc/todo.txt | 126 +++----- runtime/filetype.vim | 8 +- runtime/ftplugin/eruby.vim | 11 +- runtime/ftplugin/falcon.vim | 6 +- runtime/ftplugin/gprof.vim | 14 +- runtime/ftplugin/ruby.vim | 221 ++++++++++--- runtime/indent/eruby.vim | 21 +- runtime/indent/falcon.vim | 455 +++++++++++++++++++++----- runtime/indent/html.vim | 648 ++++++++++++++++++++++++++------------ runtime/indent/ruby.vim | 321 ++++++++++++++----- runtime/syntax/eruby.vim | 13 +- runtime/syntax/gprof.vim | 4 +- runtime/syntax/javascript.vim | 3 +- runtime/syntax/objc.vim | 534 ++++++++++++++++++++++++------- runtime/syntax/proto.vim | 74 +++++ runtime/syntax/ruby.vim | 137 ++++---- runtime/syntax/xml.vim | 6 +- 32 files changed, 2102 insertions(+), 827 deletions(-) create mode 100644 runtime/compiler/rake.vim create mode 100644 runtime/syntax/proto.vim (limited to 'runtime') diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index f89be52e99..e1064c8a58 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -1,9 +1,7 @@ " Vim completion script " Language: Ruby " Maintainer: Mark Guzman -" Last Change: 2009 Sep 28 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site +" URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " Maintainer Version: 0.8.1 " ---------------------------------------------------------------------------- @@ -12,16 +10,23 @@ " ---------------------------------------------------------------------------- " {{{ requirement checks + +function! s:ErrMsg(msg) + echohl ErrorMsg + echo a:msg + echohl None +endfunction + if !has('ruby') - s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" ) - s:ErrMsg( "Error: falling back to syntax completion" ) + call s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" ) + call s:ErrMsg( "Error: falling back to syntax completion" ) " lets fall back to syntax completion setlocal omnifunc=syntaxcomplete#Complete finish endif if version < 700 - s:ErrMsg( "Error: Required vim >= 7.0" ) + call s:ErrMsg( "Error: Required vim >= 7.0" ) finish endif " }}} requirement checks @@ -51,12 +56,6 @@ endif " {{{ vim-side support functions let s:rubycomplete_debug = 0 -function! s:ErrMsg(msg) - echohl ErrorMsg - echo a:msg - echohl None -endfunction - function! s:dprint(msg) if s:rubycomplete_debug == 1 echom a:msg @@ -133,7 +132,7 @@ function! s:GetRubyVarType(v) let stopline = 1 let vtp = '' let pos = getpos('.') - let sstr = '^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$' + let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$' let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 call setpos('.',pos) @@ -275,7 +274,7 @@ class VimRubyCompletion pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef ) load_buffer_class( $2 ) if pare != nil && $2 != name # load parent class if needed - mixre = /.*\n\s*include\s*(.*)\s*\n/.match( classdef ) + mixre = /.*\n\s*(include|prepend)\s*(.*)\s*\n/.match( classdef ) load_buffer_module( $2 ) if mixre != nil && $2 != name # load mixins if needed begin @@ -364,6 +363,10 @@ class VimRubyCompletion print txt if @@debug end + def escape_vim_singlequote_string(str) + str.to_s.gsub(/'/,"\\'") + end + def get_buffer_entity_list( type ) # this will be a little expensive. loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading") @@ -526,9 +529,9 @@ class VimRubyCompletion end def clean_sel(sel, msg) - sel.delete_if { |x| x == nil } - sel.uniq! - sel.grep(/^#{Regexp.quote(msg)}/) if msg != nil + ret = sel.reject{|x|x.nil?}.uniq + ret = ret.grep(/^#{Regexp.quote(msg)}/) if msg != nil + ret end def get_rails_view_methods @@ -767,10 +770,10 @@ class VimRubyCompletion constants = clean_sel( constants, message ) valid = [] - valid += methods.collect { |m| { :name => m, :type => 'm' } } - valid += variables.collect { |v| { :name => v, :type => 'v' } } - valid += classes.collect { |c| { :name => c, :type => 't' } } - valid += constants.collect { |d| { :name => d, :type => 'd' } } + valid += methods.collect { |m| { :name => m.to_s, :type => 'm' } } + valid += variables.collect { |v| { :name => v.to_s, :type => 'v' } } + valid += classes.collect { |c| { :name => c.to_s, :type => 't' } } + valid += constants.collect { |d| { :name => d.to_s, :type => 'd' } } valid.sort! { |x,y| x[:name] <=> y[:name] } outp = "" @@ -779,7 +782,7 @@ class VimRubyCompletion rg.step(150) do |x| stpos = 0+x enpos = 150+x - valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ] } + valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ].map{|x|escape_vim_singlequote_string(x)} } outp.sub!(/,$/, '') VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp) diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim index 614fc17f6f..45ad5eeadf 100644 --- a/runtime/compiler/eruby.vim +++ b/runtime/compiler/eruby.vim @@ -1,9 +1,7 @@ " Vim compiler file " Language: eRuby " Maintainer: Doug Kearns -" Last Change: 2008 Aug 1 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site +" URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns if exists("current_compiler") diff --git a/runtime/compiler/rake.vim b/runtime/compiler/rake.vim new file mode 100644 index 0000000000..3bd9da0daf --- /dev/null +++ b/runtime/compiler/rake.vim @@ -0,0 +1,35 @@ +" Vim compiler file +" Language: Rake +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby +" Release Coordinator: Doug Kearns + +if exists("current_compiler") + finish +endif +let current_compiler = "rake" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=rake + +CompilerSet errorformat= + \%D(in\ %f), + \%\\s%#from\ %f:%l:%m, + \%\\s%#from\ %f:%l:, + \%\\s%##\ %f:%l:%m, + \%\\s%##\ %f:%l, + \%\\s%#[%f:%l:\ %#%m, + \%\\s%#%f:%l:\ %#%m, + \%\\s%#%f:%l:, + \%m\ [%f:%l]: + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8: diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim index f46527ef1c..7c340bab15 100644 --- a/runtime/compiler/rspec.vim +++ b/runtime/compiler/rspec.vim @@ -1,9 +1,7 @@ " Vim compiler file " Language: RSpec " Maintainer: Tim Pope -" Last Change: 2009 Dec 22 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site +" URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns if exists("current_compiler") @@ -18,21 +16,15 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=spec +CompilerSet makeprg=rspec CompilerSet errorformat= - \%+W'%.%#'\ FAILED, - \%+I'%.%#'\ FIXED, - \%-Cexpected:%.%#, - \%-C\ \ \ \ \ got:%.%#, + \%f:%l:\ %tarning:\ %m, \%E%.%#:in\ `load':\ %f:%l:%m, - \%C%f:%l:, - \%W%f:%l:\ warning:\ %m, - \%E%f:%l:in\ %*[^:]:\ %m, - \%E%f:%l:\ %m, - \%-Z%\tfrom\ %f:%l, - \%-Z%p^%.%#, - \%-C%.%#, + \%E%f:%l:in\ `%*[^']':\ %m, + \%-Z\ \ \ \ \ \#\ %f:%l:%.%#, + \%E\ \ %\\d%\\+)%.%#, + \%C\ \ \ \ \ %m, \%-G%.%# let &cpo = s:cpo_save diff --git a/runtime/compiler/ruby.vim b/runtime/compiler/ruby.vim index 9499ce1897..dcf7a40129 100644 --- a/runtime/compiler/ruby.vim +++ b/runtime/compiler/ruby.vim @@ -1,33 +1,10 @@ " Vim compiler file " Language: Ruby " Function: Syntax check and/or error reporting -" Maintainer: Tim Hammerquist -" Last Change: 2008 Aug 1 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site +" Maintainer: Tim Pope +" URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns " ---------------------------------------------------------------------------- -" -" Changelog: -" 0.2: script saves and restores 'cpoptions' value to prevent problems with -" line continuations -" 0.1: initial release -" -" Contributors: -" Hugh Sasse -" Doug Kearns -" -" Todo: -" match error type %m -" -" Comments: -" I know this file isn't perfect. If you have any questions, suggestions, -" patches, etc., please don't hesitate to let me know. -" -" This is my first experience with 'errorformat' and compiler plugins and -" I welcome any input from more experienced (or clearer-thinking) -" individuals. -" ---------------------------------------------------------------------------- if exists("current_compiler") finish diff --git a/runtime/compiler/rubyunit.vim b/runtime/compiler/rubyunit.vim index 524c205f8a..93a0c8e653 100644 --- a/runtime/compiler/rubyunit.vim +++ b/runtime/compiler/rubyunit.vim @@ -1,9 +1,7 @@ " Vim compiler file " Language: Test::Unit - Ruby Unit Testing Framework " Maintainer: Doug Kearns -" Last Change: 2008 Aug 1 -" URL: http://vim-ruby.rubyforge.org -" Anon CVS: See above site +" URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns if exists("current_compiler") diff --git a/runtime/compiler/xmllint.vim b/runtime/compiler/xmllint.vim index 8fde4e10f1..ddd4960485 100644 --- a/runtime/compiler/xmllint.vim +++ b/runtime/compiler/xmllint.vim @@ -1,8 +1,7 @@ " Vim compiler file " Compiler: xmllint -" Maintainer: Doug Kearns -" URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/xmllint.vim -" Last Change: 2004 Nov 27 +" Maintainer: Doug Kearns +" Last Change: 2013 Jun 1 if exists("current_compiler") finish @@ -18,10 +17,8 @@ set cpo-=C CompilerSet makeprg=xmllint\ --valid\ --noout\ -CompilerSet errorformat=%E%f:%l:\ error:\ %m, - \%W%f:%l:\ warning:\ %m, - \%E%f:%l:\ validity\ error:\ %m, - \%W%f:%l:\ validity\ warning:\ %m, +CompilerSet errorformat=%+E%f:%l:\ %.%#\ error\ :\ %m, + \%+W%f:%l:\ %.%#\ warning\ :\ %m, \%-Z%p^, \%-G%.%# diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 09eb22dbd5..4dad269175 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3. Last change: 2013 May 21 +*eval.txt* For Vim version 7.3. Last change: 2013 Jun 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2775,7 +2775,8 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* file name contains a space] If the expansion fails, the result is an empty string. A name - for a non-existing file is not included. + for a non-existing file is not included, unless {expr} does + not start with '%', '#' or '<', see below. When {expr} starts with '%', '#' or '<', the expansion is done like for the |cmdline-special| variables with their associated diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 6b46c9f029..70c1a68e5b 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 7.3. Last change: 2011 Jul 22 +*gui.txt* For Vim version 7.3. Last change: 2013 Jun 12 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 0dd632b0c7..7e89059b19 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 7.3. Last change: 2013 May 20 +*indent.txt* For Vim version 7.3. Last change: 2013 Jun 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -729,6 +729,50 @@ buffer-local variable as follows > let b:fortran_indent_less=1 +HTML *ft-html-indent* *html-indent* *html-indenting* + +This is about variables you can set in your vimrc to customize HTML indenting. + +You can set the indent for the first line after