Commenting out with Cmd-Shift-7 fails

<oXygen/> general issues.
derBunte
Posts: 11
Joined: Fri Sep 14, 2007 11:27 am
Location: Germany

Commenting out with Cmd-Shift-7 fails

Post by derBunte » Fri Dec 14, 2018 3:54 pm

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.

adrian
Posts: 2530
Joined: Tue May 17, 2005 4:01 pm

Re: Commenting out with Cmd-Shift-7 fails

Post by adrian » Mon Dec 17, 2018 3:28 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

derBunte
Posts: 11
Joined: Fri Sep 14, 2007 11:27 am
Location: Germany

Re: Commenting out with Cmd-Shift-7 fails

Post by derBunte » Mon Dec 17, 2018 3:47 pm

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

adrian
Posts: 2530
Joined: Tue May 17, 2005 4:01 pm

Re: Commenting out with Cmd-Shift-7 fails

Post by adrian » Mon Dec 17, 2018 7:47 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply