{"action":"created","issue":{"url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/273","repository_url":"https://api.github.com/repos/vim-ruby/vim-ruby","labels_url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/273/comments","events_url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/273/events","html_url":"https://github.com/vim-ruby/vim-ruby/issues/273","id":112113655,"number":273,"title":"Indent correctly with chaining methods with do/end","user":{"login":"teoljungberg","id":810650,"avatar_url":"https://avatars.githubusercontent.com/u/810650?v=3","gravatar_id":"","url":"https://api.github.com/users/teoljungberg","html_url":"https://github.com/teoljungberg","followers_url":"https://api.github.com/users/teoljungberg/followers","following_url":"https://api.github.com/users/teoljungberg/following{/other_user}","gists_url":"https://api.github.com/users/teoljungberg/gists{/gist_id}","starred_url":"https://api.github.com/users/teoljungberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teoljungberg/subscriptions","organizations_url":"https://api.github.com/users/teoljungberg/orgs","repos_url":"https://api.github.com/users/teoljungberg/repos","events_url":"https://api.github.com/users/teoljungberg/events{/privacy}","received_events_url":"https://api.github.com/users/teoljungberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vim-ruby/vim-ruby/labels/indent","name":"indent","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-19T10:03:39Z","updated_at":"2016-05-30T18:44:46Z","closed_at":null,"body":"When I have a method that looks like:\r\n\r\n```ruby\r\ndef some_method(collection)\r\n  result = collection.\r\n    select { |element| do_something_to_the_element(element) }.\r\n    map do\r\n      do_something_strange_to_the_element_so_this_line_goes_over_80_characters_like_it_should_not_do\r\n    end\r\n\r\n\r\n    this_line_should_be_outdented_one_level_but_is_not\r\nend\r\n```\r\n\r\nVim will indent `this_line_should_be_outdented_one_level_but_is_not` to the same level as the last `end`  of the `select` block. When I expect it to be indented the same as `result`"},"comment":{"url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/comments/222539921","html_url":"https://github.com/vim-ruby/vim-ruby/issues/273#issuecomment-222539921","issue_url":"https://api.github.com/repos/vim-ruby/vim-ruby/issues/273","id":222539921,"user":{"login":"AndrewRadev","id":124255,"avatar_url":"https://avatars.githubusercontent.com/u/124255?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewRadev","html_url":"https://github.com/AndrewRadev","followers_url":"https://api.github.com/users/AndrewRadev/followers","following_url":"https://api.github.com/users/AndrewRadev/following{/other_user}","gists_url":"https://api.github.com/users/AndrewRadev/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewRadev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewRadev/subscriptions","organizations_url":"https://api.github.com/users/AndrewRadev/orgs","repos_url":"https://api.github.com/users/AndrewRadev/repos","events_url":"https://api.github.com/users/AndrewRadev/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewRadev/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T18:44:46Z","updated_at":"2016-05-30T18:44:46Z","body":"Sorry for taking so long to get to this issue.\r\n\r\nSo, I've just pushed a commit that fixes the problem, but likely not in the way you'd prefer. If you pull master now, the result you'll get will be (hopefully):\r\n\r\n``` ruby\r\ndef some_method(collection)\r\n  result = collection.\r\n    select { |element| do_something_to_the_element(element) }.\r\n    map do\r\n    do_something_else\r\n  end\r\n\r\n  this_line_should_be_outdented_one_level_but_is_not\r\nend\r\n```\r\n\r\nThe `collection.select { }.map` is considered a single line broken up by dots, and the block's contents align to the `result =` line rather than the immediate parent.\r\n\r\nHowever, as you've noticed, #292 has something to do with this, and I've merged that one as well. So, if you change a setting like so:\r\n\r\n``` vim\r\n:let g:ruby_indent_block_style = 'do'\r\n```\r\n\r\nThen the result you'll (hopefully) get is what you expected:\r\n\r\n``` ruby\r\ndef some_method(collection)\r\n  result = collection.\r\n    select { |element| do_something_to_the_element(element) }.\r\n    map do\r\n      do_something_else\r\n    end\r\n\r\n  this_line_should_be_outdented_one_level_but_is_not\r\nend\r\n```\r\n\r\nLet me know what you think."}}
{"actor":{"display_login":"AndrewRadev"}}