Skip to content

Commit

Permalink
Highlight negative sign; remove Vim 5.x stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Sep 6, 2007
1 parent 735a355 commit f517c02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2007-09-06 Tim Pope <vim@tpope.info>

* syntax/eruby.vim: remove Vim 5.x specific sections
* syntax/ruby.vim: highlight negative sign in numbers

2007-08-07 Tim Pope <vim@tpope.info>

* indent/ruby.vim: fix while/until/for match in skip regexp
Expand Down
15 changes: 2 additions & 13 deletions syntax/eruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,10 @@ exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:erub
exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend'

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_eruby_syntax_inits")
if version < 508
let did_ruby_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif

HiLink erubyDelimiter Delimiter
HiLink erubyComment Comment
hi def link erubyDelimiter Delimiter
hi def link erubyComment Comment

delcommand HiLink
endif
let b:current_syntax = 'eruby'

if main_syntax == 'eruby'
Expand Down
12 changes: 6 additions & 6 deletions syntax/ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedPare

" Numbers and ASCII Codes
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
syn match rubyInteger "\<0[xX]\x\+\%(_\x\+\)*\>" display
syn match rubyInteger "\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
syn match rubyInteger "\<0[oO]\=\o\+\%(_\o\+\)*\>" display
syn match rubyInteger "\<0[bB][01]\+\%(_[01]\+\)*\>" display
syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display
syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*\>" display
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display

" Identifiers
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
Expand Down

0 comments on commit f517c02

Please sign in to comment.