GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Wrong indentation on "end" keyword · Issue #333 · vim-ruby/vim-ruby

Wrong indentation on "end" keyword #333

New issue
Copy link
New issue
Copy link
Open
Open
Wrong indentation on "end" keyword#333
Copy link
Labels
indent

Description

@khangal
khangal
opened on Feb 12, 2017
Issue body actions

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. khangal
    closed this as completedon Nov 20, 2017
  2. dkearns
    added
    indent
    on Dec 11, 2018
  3. AndrewRadev commented on Feb 5, 2021

    @AndrewRadev
    AndrewRadev
    on Feb 5, 2021
    Member
    More actions

    @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.

  4. AndrewRadev
    reopened this on Feb 5, 2021
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

    indent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.