Various indentation issues (eruby-html)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nXhtml |
New
|
Undecided
|
Unassigned |
Bug Description
Like discussed previously in Rails on Emacs group.
Each example starts indented as I'd like it to be, then I move to various lines, press Tab, and observe the changes.
1 <a href="#" title="<%= abc(@zz) %>" class="image">
2 <%= image_tag (@zz.photos.first ? @zz.photos.
3 : '/images/
4 </a>
I move point to line 2, press Tab, nothing happens (good). Move to
line 3, press Tab -> the text on line 2 gets un-indented by 2 spaces
(!!), and the minibuffer says "Do not know how to indent here (both
leaving and entering sub chunks)". No idea why.
1 <td>
2 <%= unless params[:abc_id]
3 link_to 'cdf', '#', class: "show_others"
4 end %>
5 </td>
Tab on line 2 -> no effect (ok), tab on line 3 -> it gets un-indented
by 4 spaces (very much not-okay). Tab on line 4 -> line 2 (!!!) gets
un-indented 2 spaces. What's up with that?
1 <li>
2 <%= f.label :fee %>:
3 <%= f.number_field :fee, :maxlength => 6 %> roubles.
4 </li>
This one's harder to reproduce. When I just paste it to the buffer, go to 2, press Tab, go to 3, press Tab, nothing changes.
But if I add a newline at the end of the buffer, move back to 3, press Tab, then it gets un-indented by 2 spaces. I tried this also with (emacs-Q-nxhtml), and while the buggy behavior is not 100% reliable, "add a newline, move back" scenario certainly helps.
Another problem I encountered while writing this: if I have one of the examples in the buffer, do C-x h (select all), and paste another from the system clipboard, thus deleting the previous buffer contents, delete the line numbers, and then press Tab to indent something, I get this:
Debugger entered--Lisp error: (wrong-
overlay-get(nil mumamo-prev-chunk)
mumamo-
mumamo-
indent-
call-
The fontification is also broken in the pasted text.
Damn, the launchpad ate all my indentation- whitespace.
Anyway, I think it should be obvious how each example should be indented, and each example should start that way.