problem in eclipse plugin

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ryanhanks
Posts: 3
Joined: Fri Sep 09, 2005 8:25 am

problem in eclipse plugin

Post by ryanhanks »

I'm having the following problem using code templates running Oxygen 6.1 in Eclipse 3.1 using the plugin:

Assume that I've just hit the enter key and my cursor has automatically indented itself to the Nth tab. I type the name of the code template and hit ctrl + space and the name is replaced replaced by the template code and my cursor is placed in the appropriate position. My problem is that the first (and possible only) line of code from the newly inserted template has moved itself one tab to the left (Nth - 1) with any enclosing tags appropriately indented to the Nth + 1 tab and with the closing tag indented to the Nth.

Examples:

Code: Select all


            <xsl:choose>
<xsl:when test="${caret}">

</xsl:when>
<xsl:otherwise>

</xsl:otherwise>
</xsl:choose>

Code: Select all


      <xsl:call-template name="${caret}">
<xsl:with-param name="" select=""/>
</xsl:call-template>
I only experience this problem when working with the Eclipse plugin and have been experiencing it since the first time I used it.

I've toggled nearly every concievable boolean option in the preferences dialog to no avail. Please Help.

Thanks.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The problem occurs only when you use tab characters for indentation, that is when the Indent with tabs option is enabled in Preferences - oXygen - Editor - Format, and you have a tab character at the left of the cursor on the line where you insert the template. We will fix it for the next version of <oXygen/>. Until then just disable the Indent with tabs option and do a pretty-print (Format and Indent) to replace the tabs with spaces before you insert a code template in the editor.

Thank you for pointing out the problem,
Sorin
ryanhanks
Posts: 3
Joined: Fri Sep 09, 2005 8:25 am

Post by ryanhanks »

That worked. Thanks, Sorin.
Post Reply