Page 1 of 1

Format and Indent - Inserts line break

Posted: Tue Aug 14, 2007 10:27 pm
by angela
I have the following settings in standalone version 8.2, but Format and Indent is still inserting a line break in the attribute list.

What other settings do I need to prevent this?

Line width - format and indent = 1000
Indent size = 4 spaces
[ ] Break line before attribute's name
[ x ] Preserve empty lines
[ x ] Preserve text as it is
[ x ] Preserve line breaks in attributes

I want my code to look like this:

Code: Select all


<xsl:variable name="a" select="if (b) 
then b
else if (c)
then c
else d" />


Instead, it looks like this:

Code: Select all

<xsl:variable name="a"
select="if (b)
then b
else if (c)
then c
else d" />
Please advise.

Posted: Wed Aug 15, 2007 3:45 pm
by sorin_ristache
Hello,

With your line width and indent size, Break line before attribute's name disabled and Preserve empty lines, Preserve text as it is and Preserve line breaks in attributes enabled the Format and Indent operation does not produce the code

Code: Select all

<xsl:variable name="a"
select="if (b)
then b
else if (c)
then c
else d" />
It does not matter the format before applying the operation. The select attribute is always on the same line with the name one. The select attribute goes to the next line only if I decrease the line width. Please send us your oXygen preferences stored in [home-folder]\Application Data\com.oxygenxml as a zip archive. [home-folder] is usually C:\Documents and Settings\login-name on Windows computers.


Regards,
Sorin

Posted: Wed Aug 15, 2007 6:29 pm
by angela
Aha - since you directed me to the properties folder, I was able to find the problem.

I did have the line width set to 1000, but the 'Detect Line Width on Open' was checked, which apparently overrides the set linewidth.

I unchecked this box and now Format and Indent works as I expect it to.

Thanks for your help!