Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NEWS; allow for eruby nesting

  • Loading branch information...
commit 51fa67dd0216b42736a1a4973b7bfbe1def5ce27 1 parent 3339278
@tpope tpope authored
Showing with 73 additions and 5 deletions.
  1. +7 −0 ChangeLog
  2. +54 −0 NEWS
  3. +11 −4 syntax/eruby.vim
  4. +1 −1  syntax/ruby.vim
View
7 ChangeLog
@@ -1,5 +1,12 @@
2007-05-06 Tim Pope <vim@tpope.info>
+ * NEWS: update documentation for next release
+ * syntax/eruby.vim: allow for nesting (foo.erb.erb)
+ * syntax/ruby.vim: removed : from rubyOptionalDoLine (falsely matches
+ on symbols, and the syntax is deprecated anyways)
+
+2007-05-06 Tim Pope <vim@tpope.info>
+
* ftplugin/ruby.vim: maps for [[, ]], [], ][, [m, ]m, [M, ]M
2007-05-06 Tim Pope <vim@tpope.info>
View
54 NEWS
@@ -1,3 +1,57 @@
+= 2007.05.07
+
+== Ruby Syntax Highlighting
+
+Highlight OPTIMIZE alongside FIXME and TODO.
+
+Multiline array literals can now be folded.
+
+== Ruby Filetype Support
+
+Added mappings for [[, ]], [], ][, [m, ]m, [M, and ]M. The first four bounce
+between class and module declarations, and the last four between method
+declarations.
+
+== eRuby Syntax Highlighting
+
+Tim Pope has taken over maintenance of the eRuby syntax file. The subtype of
+the file is now determined dynamically from the filename, rather than being
+hardwired to HTML. It can be overridden with b:eruby_subtype.
+
+== eRuby Filetype Support
+
+Tim Pope has taken over maintenance of the eRuby filetype plugin. Like with
+the syntax file, the subtype is now determined dynamically.
+
+== eRuby Indenting
+
+As with the syntax file and filetype plugin, the subtype is now determined
+dynamically.
+
+== Bug Fixes
+
+Ruby syntax file
+ - when ruby_operators is set, highlight scope and range operators, and don't
+ match '>' in =>'
+ - regexp literals are highlighted after the 'else' keyword
+ - don't match [!=?] as part of a sigil prefixed symbol name
+ - allow text to appear after, and on the same line, as '=begin' in
+ rubyDocumentation regions
+ - highlight %s() ans a symbol, not a string
+ - eliminated some false positves for here docs, symbols, ASCII codes, and
+ conditionals as statement modifiers
+ - added "neus" to regexp flags
+ - Highlight punctuation variables in string interpolation, and flag invalid
+ ones as errors
+ - removed : from rubyOptionalDoLine (falsely matches on symbols)
+
+Ruby filetype plugin
+ - eliminated some false positives with the matchit patterns
+
+Ruby indent plugin
+ - ignore instance, class, and global variables named "end"
+
+
= 2007.03.02
== Omni Completion
View
15 syntax/eruby.vim
@@ -40,6 +40,13 @@ if !exists("b:eruby_subtype") && main_syntax == 'eruby'
endif
endif
+if !exists("b:eruby_nest_level")
+ let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.erb\>','@','g'),'[^@]','','g'))
+endif
+if !b:eruby_nest_level
+ let b:eruby_nest_level = 1
+endif
+
if exists("b:eruby_subtype") && b:eruby_subtype != ''
exe "runtime! syntax/".b:eruby_subtype.".vim"
unlet! b:current_syntax
@@ -48,10 +55,10 @@ syn include @rubyTop syntax/ruby.vim
syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment
-syn region erubyOneLiner matchgroup=erubyDelimiter start="^%%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erbRegions keepend oneline
-syn region erubyBlock matchgroup=erubyDelimiter start="<%%\@!-\=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions
-syn region erubyExpression matchgroup=erubyDelimiter start="<%=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions
-syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="-\=%>" contains=rubyTodo,@Spell containedin=ALLBUT,@erbRegions keepend
+exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erbRegions keepend oneline'
+exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions'
+exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions'
+exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%>" contains=rubyTodo,@Spell containedin=ALLBUT,@erbRegions keepend'
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
View
2  syntax/ruby.vim
@@ -198,7 +198,7 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
syn keyword rubyConditional then else elsif contained containedin=rubyConditionalExpression
" statements with optional 'do'
- syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\|:\)" end="\ze\%(;\|$\)" oneline contains=TOP
+ syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=TOP
syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=TOP nextgroup=rubyOptionalDoLine fold
if !exists("ruby_minlines")
Please sign in to comment.
Something went wrong with that request. Please try again.