Incorrect indentation of operator continuations in blocks #81

garybernhardt opened this Issue May 8, 2012 · 2 comments

2 participants


As of current master (3e56518), this code is indented incorrectly:

    x { y >>
        z }

w should be lined up with x.

For curiosity, the actual code where I found this indentation problem was a Parslet parser (shown without indentation bug here):

    rule(:id)      { space? >>
                     keyword.absent? >> match('[a-z+\-*]').repeat(1) >>
                     space? }
    rule(:keyword) { str("def") }
Vim-Ruby member

From what I understand, the problem is the same as the one causing issue #83, so I'm going to close this as a duplicate and take the discussion there.


Ahh, yes—it doesn't indent this way if the terminator is on its own line. That didn't cross my mind. Thanks, Andrew.

@AndrewRadev AndrewRadev added a commit that referenced this issue Mar 17, 2013
@AndrewRadev AndrewRadev Merge branch 'tests'
* tests:
  Spec for issue 132
  Spec for issue 108
  Tests for issue 130
  One more spec for issue #81
  Migrate an example to a spec
  Introduce tests
@aschrab aschrab added a commit to aschrab/vim-ruby that referenced this issue Sep 24, 2013
@aschrab aschrab Merge branch 'master' into folding
* master:
  Workaround for Vim 7.4's HTML indent
  Another missing "*" escape
  Missing escape() for '*'
  allow Gemfile gems to be parsed and required
  Fix constant definitions after comments.
  Highlight unicode characters in constants
  Simplify ruby*Constant syntax group matching
  Remove s:save_cpo when we're done with it
  Fix keyword symbols after parentheses
  Basic "<<"-style heredoc indenting
  Reformat installer.
  Fix deprecation error.
  Work around weird --remote skip of finally
  Add appraisals to filetype detection.
  Fix Windows shell escaping issue
  Fix continuation issue again
  Spec for issue 132
  Spec for issue 108
  Tests for issue 130
  One more spec for issue #81
  Migrate an example to a spec
  Introduce tests
  Add a rake compiler plugin
  Remove "Anon CVS" headers
  Highlight Ruby 2.0 symbol array syntax (%i)
  Add support for public_constant & private_constant (added in Ruby 1.9.3)
  Revert "Add symbols to string-like patterns"
  Correctly highlight identifiers with unicode characters
  Support Ruby 2.0's prepend keyword
  Fix incorrect match group reference
  Add symbols to string-like patterns
  Use s:Match instead of =~ to avoid matching strings or comments
  Highlight regexps after <<, +, -, and *
  Fix error when editing virtual files
  Highlight Ruby 1.9 overloadable operators
  Fix 'tags' in the default Ruby case
  Experimental support for .ruby-version
  Remove debugging variable
  Watch out for indent keywords with hanging brackets
  Adjust indenting after lines like "],"
  Remove unnecessary check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment