Skip to content

Commit 25074cb

Browse files
committed
Fix highlighting of required trailing keyword parameters
E.g., def foo bar:; end
1 parent d530625 commit 25074cb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

spec/syntax/methods_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ def foo bar=:baz
2929
end
3030
EOF
3131
end
32+
33+
specify "unparenthesised method parameters with a required trailing keyword then semicolon" do
34+
assert_correct_highlighting <<~'EOF', 'bar', 'rubySymbol'
35+
def foo bar:; end
36+
EOF
37+
end
3238
end

syntax/ruby.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ if !exists("ruby_no_special_methods")
461461
endif
462462
syn match rubyDefinedOperator "\<defined?" display
463463

464-
" More Symbols {{{1
464+
" More Symbols - 1.9-style hash keys and keyword parameters {{{1
465465
syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1
466-
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
466+
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1
467467

468468
" __END__ Directive {{{1
469469
SynFold '__END__' syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$"

0 commit comments

Comments
 (0)