I can't indent html at all.

View: New views
9 Messages — Rating Filter:   Alert me  

I can't indent html at all.

by Ryan Shillington-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys,

I had previously installed all kinds of rails plugins (probably a mismash of things contributed to this project in their earlier days), so I uninstalled Vim altogether, did a clean re-install of Vim 7.0 on Windows and installed this vim-ruby stuff (version 2007.05.07) using the gem.

Now, whenever I select code that looks like the following:

<% if(@show_confirmation)%>
  <div id="confirmationHeaderDiv">
    <table style="width: 100%;">
      <tr>
        <td><img src="/images/leftYellowTab.gif" width="11" height="13"></td>
        <td class="yellowBackground" style="width: 100%;"></td>
        <td><img src="/images/rightYellowTab.gif" width="11" height="13"></td>
      </tr>
    </table>
    <div id="confirmationHeaderImageDiv"><%=image_tag("checkout/step5.gif", :align =>"center", :border=> 0, :width => 451, :height => 71) %></div>
  </div>
<%end%>


and press "=" which used to indent the HTML for me, I now see:

<% if(@show_confirmation)%>
  <div id="confirmationHeaderDiv">
  <table style="width: 100%;">
  <tr>
  <td><img src="/images/leftYellowTab.gif" width="11" height="13"></td>
  <td class="yellowBackground" style="width: 100%;"></td>
  <td><img src="/images/rightYellowTab.gif" width="11" height="13"></td>
  </tr>
  </table>
  <div id="confirmationHeaderImageDiv"><%=image_tag("checkout/step5.gif", :align =>"center", :border=> 0, :width => 451, :height => 71) %></div>
  </div>
<%end%>

Ah!!! It's destroyed my html formating.  The filename is called show.rhtml and I checked that the filetype is being recognized as eruby.  My _vimrc is available here ( http://www.thebookhauler.com/vimRuby/_vimrc) although I tried it without my _vimrc and got the same results. 

Any ideas what I might be doing wrong?  That used to work.

Thanks in advance,

Ryan

_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Doug Kearns :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

G'day Ryan,

On 5/10/07, Ryan Shillington <ryanshillington@...> wrote:
> Hey guys,
>
> I had previously installed all kinds of rails plugins (probably a mismash of
> things contributed to this project in their earlier days), so I uninstalled
> Vim altogether, did a clean re-install of Vim 7.0 on Windows and installed
> this vim-ruby stuff (version 2007.05.07) using the gem.
>
> Now, whenever I select code that looks like the following:

<snip>

> Ah!!! It's destroyed my html formating.  The filename is called show.rhtml
> and I checked that the filetype is being recognized as eruby.  My _vimrc is
> available here (
> http://www.thebookhauler.com/vimRuby/_vimrc) although I
> tried it without my _vimrc and got the same results.
>
> Any ideas what I might be doing wrong?  That used to work.

FWIW, this works for me on a Windows box....

Your results seem to me to be consistent with the HTML indent file not
being sourced.  What does :let b:eruby_subtype return?  Is the Ruby
indented?

<%
  if true
    puts "indenting works here"
  end
%>

Thanks,
Doug
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Ryan Shillington-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Doug,

Yup, the ruby is indented just fine.  The result of ":let b:eruby_subtype" is "b:eruby_subtype       html".

Thanks for the quick reply - I appreciate it.

Ryan

On 5/9/07, Doug Kearns <dougkearns@...> wrote:
G'day Ryan,

On 5/10/07, Ryan Shillington <ryanshillington@...> wrote:
> Hey guys,
>
> I had previously installed all kinds of rails plugins (probably a mismash of
> things contributed to this project in their earlier days), so I uninstalled
> Vim altogether, did a clean re-install of Vim 7.0 on Windows and installed
> this vim-ruby stuff (version 2007.05.07) using the gem.
>
> Now, whenever I select code that looks like the following:

<snip>

> Ah!!! It's destroyed my html formating.  The filename is called show.rhtml
> and I checked that the filetype is being recognized as eruby.  My _vimrc is
> available here (
> http://www.thebookhauler.com/vimRuby/_vimrc) although I
> tried it without my _vimrc and got the same results.
>
> Any ideas what I might be doing wrong?  That used to work.

FWIW, this works for me on a Windows box....

Your results seem to me to be consistent with the HTML indent file not
being sourced.  What does :let b:eruby_subtype return?  Is the Ruby
indented?

<%
  if true
    puts "indenting works here"
  end
%>

Thanks,
Doug
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel


_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Doug Kearns :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 5/11/07, Ryan Shillington <ryanshillington@...> wrote:
> Hi Doug,
>
> Yup, the ruby is indented just fine.  The result of ":let b:eruby_subtype"
> is "b:eruby_subtype       html".

Hmm, does :scriptnames include .../indent/html.vim when run on an *.rhtml file?

What does :let b:eruby_subtype_indentexpr return?

Doug
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Tim Pope-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, May 10, 2007 at 10:11:05AM -0500, Ryan Shillington wrote:
> Hi Doug,
>
> Yup, the ruby is indented just fine.  The result of ":let b:eruby_subtype"
> is "b:eruby_subtype       html".
>
> Thanks for the quick reply - I appreciate it.

In addition to what Doug asked you to check, can you tell me if you
have syntax highlighting and/or filetype plugins enabled?  If so, does
the syntax highlighting appear to be working correctly?
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Ryan Shillington-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, when I run :scriptnames line 35 is c:\vim\vim70\indent\html.vim. "let b:eruby_subtype_indentexpr" returns "HtmlIndentGet(v:lnum)".

To Tim, yes, I do have syntax highlighting turned on, and it's working.  I have the following lines in my _vimrc:

syntax on             " Enable syntax highlighting
filetype on           " Enable filetype detection
filetype indent on    " Enable filetype-specific indenting
filetype plugin on    " Enable filetype-specific plugins

Sorry to be such a pain.  Thanks again for your help.

Ryan



On 5/10/07, Tim Pope <vim-ruby-devel@...> wrote:
On Thu, May 10, 2007 at 10:11:05AM -0500, Ryan Shillington wrote:
> Hi Doug,
>
> Yup, the ruby is indented just fine.  The result of ":let b:eruby_subtype"
> is "b:eruby_subtype       html".
>
> Thanks for the quick reply - I appreciate it.

In addition to what Doug asked you to check, can you tell me if you
have syntax highlighting and/or filetype plugins enabled?  If so, does
the syntax highlighting appear to be working correctly?
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel


_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Tim Pope-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 11, 2007 at 08:57:16AM -0500, Ryan Shillington wrote:

> Yes, when I run :scriptnames line 35 is c:\vim\vim70\indent\html.vim. "let
> b:eruby_subtype_indentexpr" returns "HtmlIndentGet(v:lnum)".
>
> To Tim, yes, I do have syntax highlighting turned on, and it's working.  I
> have the following lines in my _vimrc:
>
> syntax on             " Enable syntax highlighting
> filetype on           " Enable filetype detection
> filetype indent on    " Enable filetype-specific indenting
> filetype plugin on    " Enable filetype-specific plugins
>
> Sorry to be such a pain.  Thanks again for your help.
>
> Ryan

Please check the value of "set indentexpr?" and confirm that it is
"GetErubyIndent()".  If it is, try putting the cursor on a line that
is indenting incorrectly (like line 2 of the following example)

<table>
<tr>

Then do

:let v:lnum = line(".")|echo GetErubyIndent()

This function is supposed to return the number of spaces that the line
should start with.  Tell me what it returns.  This might be an error
message, or multiple error messages.  If you have trouble copying and
pasting these errors, do

:redir @">

before the command and

redir END

afterwords.  This will copy the content where it can be pasted with
"p".

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Ryan Shillington-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, "set indentexpr?" returns "GetErubyIndent()".

When I put my cursor on the <tr> line in your example, I get zero - no error messages.  Strange.

When I wrapped it in a ruby <% if %> statement, it returned 2 - so it's returning the right number, its just not taking the HTML level into account.   Really strange.

Ryan

On 5/11/07, Tim Pope <vim-ruby-devel@...> wrote:
On Fri, May 11, 2007 at 08:57:16AM -0500, Ryan Shillington wrote:

> Yes, when I run :scriptnames line 35 is c:\vim\vim70\indent\html.vim. "let
> b:eruby_subtype_indentexpr" returns "HtmlIndentGet(v:lnum)".
>
> To Tim, yes, I do have syntax highlighting turned on, and it's working.  I
> have the following lines in my _vimrc:
>
> syntax on             " Enable syntax highlighting
> filetype on           " Enable filetype detection
> filetype indent on    " Enable filetype-specific indenting
> filetype plugin on    " Enable filetype-specific plugins
>
> Sorry to be such a pain.  Thanks again for your help.
>
> Ryan

Please check the value of "set indentexpr?" and confirm that it is
"GetErubyIndent()".  If it is, try putting the cursor on a line that
is indenting incorrectly (like line 2 of the following example)

<table>
<tr>

Then do

:let v:lnum = line(".")|echo GetErubyIndent()

This function is supposed to return the number of spaces that the line
should start with.  Tell me what it returns.  This might be an error
message, or multiple error messages.  If you have trouble copying and
pasting these errors, do

:redir @">

before the command and

redir END

afterwords.  This will copy the content where it can be pasted with
"p".

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel


_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel

Re: I can't indent html at all.

by Tim Pope-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, May 13, 2007 at 06:02:25PM -0500, Ryan Shillington wrote:
> Yes, "set indentexpr?" returns "GetErubyIndent()".
>
> When I put my cursor on the <tr> line in your example, I get zero - no error
> messages.  Strange.
>
> When I wrapped it in a ruby <% if %> statement, it returned 2 - so it's
> returning the right number, its just not taking the HTML level into
> account.   Really strange.

Try :echo HtmlIndentGet(line('.')) and see what that says.  Then try
:set ft=html and the same echo command and see if it changes.

You should also to try experimenting with removing all other plugins.
I'm starting to suspect foul play on someone else's part.

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
vim-ruby-devel@...
http://rubyforge.org/mailman/listinfo/vim-ruby-devel