Skip to content

Commit

Permalink
Fix continuation issue again
Browse files Browse the repository at this point in the history
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
AndrewRadev committed Mar 17, 2013
1 parent 783dfa5 commit 260897a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indent/ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions spec/indent/continuations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.