Permalink
Browse files

Fix issue with interpolation in ruby heredocs

  • Loading branch information...
1 parent fc992fd commit e865f7cacf05908668ed07be2db553f4fb4d56fd @AndrewRadev AndrewRadev committed Oct 7, 2016
Showing with 18 additions and 2 deletions.
  1. +2 −2 indent/ruby.vim
  2. +16 −0 spec/indent/strings_spec.rb
View
@@ -49,11 +49,11 @@ let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
" Regex of syntax group names that are strings.
let s:syng_string =
- \ '\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\)\>'
+ \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\)\>'
" Regex of syntax group names that are strings or documentation.
let s:syng_stringdoc =
- \'\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\|Documentation\)\>'
+ \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\|Documentation\)\>'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr =
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe "Indenting" do
+ specify "heredoc strings are left as-is" do
+ # See https://github.com/vim-ruby/vim-ruby/issues/318 for details
+ assert_correct_indenting <<-EOF
+ def foo
+ <<-EOS
+ one
+ \#{two} three
+ four
+ EOS
+ end
+ EOF
+ end
+end

0 comments on commit e865f7c

Please sign in to comment.