Page 1 of 1

Commenting out with Cmd-Shift-7 fails

Posted: Fri Dec 14, 2018 3:54 pm
by derBunte
In the XML editor I try to comment a selection of lines and use the command "switch comment" (I don't have the English vesion here) which I have bound to Cmd-Shift-7. What happens is that a comment appears and then dissapears.

When I bind this command to another key (for example Cmd-F10), everything is fine.

I expect that the commment just appears, and not dissapears again.

Re: Commenting out with Cmd-Shift-7 fails

Posted: Mon Dec 17, 2018 3:28 pm
by adrian
Hello,

What version of Oxygen are you using (Help > About)?
Java 8 (and possibly 7) has some issues on Mac with Cmd-Shift-? shortcuts (especially in combination with numeric or symbol keys) in that the bound action gets triggered twice. So, in your case the "Toggle comment" action gets triggered twice when you press Cmd-Shift-7.

You seem to have already identified the workaround. Try using a different shortcut that does not combine Cmd and Shift.

Regards,
Adrian

Re: Commenting out with Cmd-Shift-7 fails

Posted: Mon Dec 17, 2018 3:47 pm
by derBunte
Hello Adrian,

I am using

<oXygen/> XML Editor 20.1, build 2018101517

on a Mac (Mojave 10.14.2)

Java 1.8.0_172

Do you know if this is solved with Java 9?

The problem with my workaround is that every text editor (for some definition of "every") uses cmd-shift-7 for toggle comments. So for oXygen I have to re-learn things...

Thanks for your answer!

Patrick

Re: Commenting out with Cmd-Shift-7 fails

Posted: Mon Dec 17, 2018 7:47 pm
by adrian
Do you know if this is solved with Java 9?
I could not accurately identify an issue on the Oracle Java bug tracking tool regarding this. In theory it should be fixed in Java 9 or 10. However, at this time Oxygen doesn't officially support Java 9 or 10.

If you want to try, it is possible to run Oxygen 20.0 and later with Java 9 or 10 (I would advise 10) with a change to the startup script 'oxygen.sh'.
After line 85 (set -- \) add a new line with:

Code: Select all

 --add-modules java.xml.bind\
To use a specific version of Java add a new line just before line 85 with the variable OXYGEN_JAVA set to point to your java binary:
OXYGEN_JAVA="/path/to/my/jre/Contents/Home/bin/java"
e.g.
OXYGEN_JAVA="/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/bin/java"

Regards,
Adrian