This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 111290 - Support HTML shortcut for wrapping selection with a HTML tag
Summary: Support HTML shortcut for wrapping selection with a HTML tag
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: RHTML (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 blocker with 1 vote (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-28 05:30 UTC by callagga
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description callagga 2007-07-28 05:30:53 UTC
Hi,

Can I request a shortcut be included to assist in automating the wrapping of a selection of HTML (or RHTML) with another
tag.  This is a very useful feature in TextMate for example.  There are a few versions of this in TextMat:

(1) Wrap selection in open/close tag.  Wraps selection and then highlights the first tag, when you type in the tag value
the closing tag is auto-matched to this.  For example:
- highlight a section of html or rhtml
- hit the hotkey(s) for short cut => a default <p> and </p> tag is put on either side of the selected text (formatted
appropriately), and the cursor is left highlight the "p" in the first tag
- enter the tag you really want there (e.g. "div") => as you type D I V in the opening tag, the closing tag is updated
automatically at the same time

(2) Wrap each selected line in open/close tag - as above but this automatically works on the line you are currently on,
i.e. you do not have to select anything as the IDE would auto select the entire line that the cursor is on and then
apply the same concept as per item (1) above.

Hope this explains things.  Reference the blog comments I'd made earlier with Tor.

-------------
Hi Tor - can you comment on whether there is a way to achieve the following textmate bundles (not sure if I'm missing
them or they were some of the harder to implement):
HTML
- Wrap selection in open/close tag (i.e. wraps selection and then highlights the first tag, when you type in the tag
value the closing tag is auto-matched to this)
- Wrap each selected line in open/close tag
Posted by GregH on July 22, 2007 at 04:39 AM PDT # 

Greg, in RHTML files try typing "r" followed by Tab to insert <% %> (r for Ruby) and "re" followed by Tab for <%= %>
(for Ruby expression. I'm not sure exactly how the HTML abbreviations would work - can you file a request with some more
specifics?
Posted by Tor Norbye on July 25, 2007 at 11:59 AM PDT #
-------------