FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Wrong indentation on "end" keyword · Issue #333 · vim-ruby/vim-ruby · GitHub

Repository navigation

Wrong indentation on "end" keyword #333

Description

Ubuntu 16.04
VIM 8.0

  1. if statement with nested erb fails
<div>
  <% if signed_in? %>
    Signed in as: <%= current_user.name %>
  foo
<% end %>
</div>
  1. else statement fails
<div>
  <% if signed_in? %>
    Signed in as: <%= current_user.name %>
<% else %>
  foo
<% end %>
</div>
  1. Without nested erb works
<div>
  <% if signed_in? %>
    Signed in as: without nested erb
    foo
  <% end %>
</div>

Activity

  1. AndrewRadev commented on Feb 5, 2021

    Member

    @tpope Can you think of what case is being handled by this code?

    vim-ruby/indent/eruby.vim

    Lines 97 to 100 in 4788a08

    if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
    \ && synID(v:lnum, match(cline, '\S') + 1, 1) != hlID('htmlEndTag')
    let ind = ind - sw
    endif

    I get the meaning, it doesn't start with a <%, but it does end in %>, but I'm not sure what its purpose is. If I comment it out, this example works, but I'm assuming something valid would break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL