There is no html comments in eruby. As a block comment it puts # instead of <!-- -->
How to have html comments along with ruby's comments on keyboard shortcuts?
No html comments in eRuby templates. How to enable?
Moderator: kfury77
Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
Please try to follow these guidelines. This will help to receive faster and more accurate response.
- Check the Support section of the corresponding product first. Chances are you will find your answer there;
- Do not create new topics for already reported problems. Add your comments to the existing topics instead;
- Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
- Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
- Include the version number of the software you are using;
- This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Re: No html comments in eRuby templates. How to enable?
I just tried it (New eRuby, typed some html, selected, block comment and got <!-- -->). I might be doing something wrong, so please give some step by step instructions on reproducing the problem.
Blumentals Software Programmer
Re: No html comments in eRuby templates. How to enable?
Yes, works well. I had to correctly set keyboard shortcuts.Aivars wrote:I just tried it (New eRuby, typed some html, selected, block comment and got <!-- -->). I might be doing something wrong, so please give some step by step instructions on reproducing the problem.
But there is another problem. I wrote about it already in the feedback form. It's not a big problem but a little inconvenient, force you to make needless mouse movements and clicks.
The editor puts line comment (// in js, # in ruby) exactly in the place where the cursor is but not at the start of the line, e.g:
alert("hello w//orld") <-- if cursor was between "w" and "o" and I pressed shortcuts for comment
Other editors place comment sign at the beginning of the line always even if cursor is in the middle of the line:
// alert("hello world") <-- let's say cursor was between "w" and "o"
Or is it configurable?
Re: No html comments in eRuby templates. How to enable?
I don't think it's configurable, but a plugin can be written to do this. If you want me to, I can try to write the plugin for you, just let me know exactly how it should behave.
Blumentals Software Programmer
Re: No html comments in eRuby templates. How to enable?
Oh, what a service. For now I do not need. Nevertheless, thank you.Aivars wrote:I don't think it's configurable, but a plugin can be written to do this. If you want me to, I can try to write the plugin for you, just let me know exactly how it should behave.
But I was right, there is a situation that there is no html comments in eRuby templates. I figured out when it happens. Please see the example:
Code: Select all
<% if(@somevar) %>
<p><%= @somevar %></p> // no html comments here, only #
<% end %>
Re: No html comments in eRuby templates. How to enable?
No there are html comments!
The direction you select the line matters:
Wow
Is this a design decision or an accidental behavior? It is convenient.
The direction you select the line matters:
Code: Select all
<% if(@somevar) %>
<p><%= @somevar %></p> // select a line from the end to the beginning <--- |, ruby comment
<p><%= @somevar %></p> // select a line from the beginning to the end | --->, HTML comment
<% end %>

Re: No html comments in eRuby templates. How to enable?
I think it depends on cursor position and whether cursor is at the ruby code block or in html code block. I'm not sure why it adds ruby comments when the cursor is in the beginning of the line, to me it doesn't make much sense but there was probably a reason for this behavior. If it gets annoying, let me know and I'll add it to bug/request tracker.
Blumentals Software Programmer