Permalink
Browse files

Fix continuation issue again

A spec was implemented for vim-ruby#139.

The issue this commit fixes is: vim-ruby#132.

By adding the `Symbol` group to the "string or syntax" pattern, some
continuations are fixed. It should not be added to the "string" pattern,
however.
  • Loading branch information...
1 parent 783dfa5 commit 260897af917d479670e2bede89f275c06cf3b1ef @AndrewRadev AndrewRadev committed Mar 17, 2013
Showing with 11 additions and 2 deletions.
  1. +2 −2 indent/ruby.vim
  2. +9 −0 spec/indent/continuations_spec.rb
View
@@ -31,9 +31,9 @@ set cpo&vim
" 1. Variables {{{1
" ============
-" Regex of syntax group names that are or delimit string or are comments.
+" Regex of syntax group names that are or delimit strings/symbols or are comments.
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
- \ '\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
+ \ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
\ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>'
" Regex of syntax group names that are strings.
@@ -130,4 +130,13 @@ def bar(
# Next indents correctly
EOF
end
+
+ specify "continuation with a hanging comma" do
+ # See https://github.com/vim-ruby/vim-ruby/issues/139 for details
+ assert_correct_indenting <<-EOF
+ thing :foo
+ thing 'a',
+ 'b'
+ EOF
+ end
end

0 comments on commit 260897a

Please sign in to comment.