Page 1 of 1
eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Thu Jul 19, 2012 5:09 pm
by Christian Roth
Hi,
the eclipse-plugin (14.0.0v2012071212, eclipse 3.7.2 Mac) shows weird cursor placement in the XML editor (text mode):
Sample file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<d>
<style>X
</style>
</d>
When placing the cursor at X and pressing Return, a new line is inserted, but the cursor jumps to the beginning of the file. This only happens when pressing return within the scope of the
style element. When that element is named other than
style, everything works as expected.
I have set Format > Indent to "Indent on enter".
What setting could lead to the above behaviour, which seems to only happen when the element is named "style"? Looks like I configured something for that element name, though I doubt jumping to the beginning of the file is something I wanted to configure...
Any help/workaround appreciated!
Regards, Christian
Re: eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Thu Jul 19, 2012 6:09 pm
by adrian
Hello,
Look in the Error Log view (Window > Show View > Error Log). Are there any errors there relating to Oxygen (com.oxygenxml)?
Check the Format preferences (Preferences, <oXygen/> > Editor > Format > XML). Are "styled" or "d" listed in any of the "Preserve space", "Default space" or "Mixed content" lists?
Regards,
Adrian
Re: eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Thu Jul 19, 2012 6:38 pm
by Christian Roth
Hello,
there are no error messages relating to oxygen in eclipse's Error Log view.
In the Format preferences, there are only elements under "Preserve space", but they do not contain style or d.
I tested in oXygen standalone (which seems to be a slightly older build than the eclipse plugin), and there, the cursor moves to the beginning of the line (i.e. it does not auto-indent). Again, in the standalone app, style is not listed as an element in any of the Format preferences.
It seems that style is hard-coded as WS preserving, which leads to not auto-indenting in the standalone version of oxygen (seems ok), and to jumping to the start of the document in the eclipse plugin (not ok). Could this be the case?
I further tested this by adding d to the "Preserve space" list. Now, when hitting Return within d, the same thing happens: A new line is inserted, and the cursor jumps to the beginning of the document. So it looks like
• style is hardcoded to be treated as WS preserving
• in the eclipse plugin, WS preserving elements make the cursor jump to the document start when hitting Return within them instead of moving to the line start
Regards, Christian
Re: eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Fri Jul 20, 2012 4:40 pm
by adrian
Hi,
We've tested and you are correct on both accounts. I've logged both bugs to our issue tracking tool and they will be resolved in the next release of Oxygen.
Note that the "jump to the document start" bug is only triggered if you disable the option Indent (when typing) in space preserve elements (default enabled) from the Format XML preferences (Preferences, <oXygen/> > Editor > Format > XML). So, in the meantime, until we fix this, if you re-enable this option, the bug is avoided.
Regards,
Adrian
Re: eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Mon Jul 30, 2012 8:54 am
by Radu
Hi Christian,
A fix for this will probably be available in the next Oxygen 14.0 minor bug fix release available on site (probably in a couple of weeks).
This RSS feed announces such minor bug fix releases:
http://www.oxygenxml.com/rssBuildID.xml
Regards,
Radu
Re: eclipse-plugin: weird cursor-placement in XML editor within element named "style"
Posted: Fri Aug 10, 2012 3:17 pm
by adrian
Hi,
I just wanted to let you know that both problems have been resolved in the latest maintenance build of Oxygen 14.0, 2012080717 (released on August 8th):
Eclipse: If the option "Indent (when typing) in space preserve elements" (Preferences, oXygen > Editor > Format > XML) was disabled, pressing ENTER between the tags of a space preserve element was moving the cursor at the beginning of the document.
Indent when typing: The indent when typing (smart enter) feature was incorrectly considering all elements named "script" and "style" as space preserve elements. This is now true only for (X)HTML documents.
You can download it from our web site:
http://www.oxygenxml.com/download.html
The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2012080717
Let us know if you encounter further problems with this new build.
Regards,
Adrian