indent on past problem

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Franck
Posts: 35
Joined: Fri Jun 03, 2005 11:00 am

indent on past problem

Post by Franck » Thu Feb 23, 2006 5:12 pm

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

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Post by Radu » Fri Feb 24, 2006 9:42 am

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.

Post Reply