Page 1 of 1

indent on past problem

Posted: Thu Feb 23, 2006 5:12 pm
by Franck
Hello there.

Just noticed a small problem (bug?) with the indent on past option, which is slightly annoying when editing my javascript nodes.

When editing the following example template, with 'indent on paste' turned ON. pasting anything in the function body will cause the line to be indented under the brace, rather than where I want it. This is annoying when pasting new line, and very annoying when pasting within an existing line.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" encoding="UTF-8"/>
<xsl:template match="/">
<script xmlns="" language="javascript" type="text/javascript" xml:space="preserve">
function handle_onload()
{
// I want to be indented here...
// but if I past anything the indent goes under the opeining brace


// This is where oxygen indent what I paste :-(
}
</script>
</xsl:template>
</xsl:stylesheet>
Thanks

Posted: Fri Feb 24, 2006 9:42 am
by Radu
Hi Franck,

There are two options that might interest you:

1) In Preferences->Editor->Format there is the "Indent On Paste" checkbox which controls whether any indentation will be done on pasting.

2)In the same page there is the option "Indent in preserve space elements". This option controls whether any indentation (even "Indent on paste") will be done in elements where space should be preserved (like the ones with the xml:space="preserve" attribute specified or the ones specified in the "Preserve Space elements" list where "script" is already added by default.

Probably disabling the "Indent in preserve space elements" option will be useful to you.

Hope this helps.
Regards, Radu.