[
https://issues.jboss.org/browse/JBIDE-14735?page=com.atlassian.jira.plugi...
]
Victor Rubezhny commented on JBIDE-14735:
-----------------------------------------
Template for button widget contains '\n' character at the end, this is the reason
of why one extra empty line occurs in text after the template is applied. It's not a
good to re-format the template by removing this '\n'-ending before insertion due
to exclude this extra empty line because if a user will want to insert template inside a
text of some line (not into an empty line, but into a line with some text and inside that
text) then resulting text will not be reformatted (template will always be inserted into
existing text without any breaking of line and text indentation).
So, if the template itself is correct (and requires the line break at the end) this extra
line will always occur in this example.
Regarding the indent, it also works as expected, because the template has no '\n'
character at the beginning, so the indentation is not applied for the first line of the
template.
If you will not press Enter at Step #2 then the template will be inserted at the same line
- and this is also expected behavior for this template. There is a bug though at the line
ending format - yet another extra empty line (with no any indentation) appears.
Improve text formatting when dropping widgets from Palette view
---------------------------------------------------------------
Key: JBIDE-14735
URL:
https://issues.jboss.org/browse/JBIDE-14735
Project: Tools (JBoss Tools)
Issue Type: Enhancement
Components: jsp/jsf/xml/html source editing
Reporter: Alexey Kazakov
Assignee: Victor Rubezhny
Labels: new_and_noteworthy
Fix For: 4.2.x
1. Suppose we have the following code:
{code}
<div data-role="page" id="page-1">
<div data-role="content">|
</div>
</div>
{code}
| marks the cursor position.
2. Press Enter right after <div data-role="content">:
{code}
<div data-role="page" id="page-1">
<div data-role="content">
|
</div>
</div>
{code}
3. Then click on *button* widget in jQuery Mobile Palette. Click on OK.
The following code is generated:
{code}
<div data-role="page" id="page-1">
<div data-role="content">
<a href="" id="button-1" data-role="button">Link
button</a>
</div>
</div>
{code}
But it should be
{code}
<div data-role="page" id="page-1">
<div data-role="content">
<a href="" id="button-1" data-role="button">Link
button</a>
</div>
</div>
{code}
instead.
Also we probably should use the preferences/settings of the editor to insert space
symbols (N spaces/tab) instead of hardcoded " ".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira