Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 235288 - Move Line(s) Up/Down duplicates line
Move Line(s) Up/Down duplicates line
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Window System
7.4
PC Mac OS X
: P2 with 13 votes (vote)
: 8.0
Assigned To: Stanislav Aubrecht
issues@platform
74patch-candidate
:
: 236716 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-30 08:13 UTC by ionuion
Modified: 2013-12-19 03:14 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
screencast (2.82 MB, video/quicktime)
2013-08-30 08:13 UTC, ionuion
Details
Log capture using the extended menubar logging. (151.03 KB, application/octet-stream)
2013-12-17 18:20 UTC, mpilone
Details
Log capture with fine menubar and action logging. (255.57 KB, application/octet-stream)
2013-12-17 18:47 UTC, mpilone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ionuion 2013-08-30 08:13:42 UTC
Created attachment 139471 [details]
screencast

Environment
Product Version: NetBeans IDE Dev (Build 201308290001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Mac OS X version 10.7.5 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/ionuion/Library/Application Support/NetBeans/dev
Cache directory: /Users/ionuion/Library/Caches/NetBeans/dev

Steps to reproduce
1. Create the Anagram Game project from the Samples set
2. Open the next two java files: WordLibrary.java and StaticWordLibrary.java
3. Modify WordLibrary.java. Don't save. 
4. Move to the other file. Place the cursor on some line. use the shortcut to move the line down (e.g. on Mac Ctrl-Shift-DOWN)

Expected result:
The line is moved

Actual result:
the line is moved and duplicated

Screencast attached
Comment 1 Milutin Kristofic 2013-09-05 13:56:20 UTC
There was change in shortcuts for mac os. See #228315. 

I cannot reproduce it on:
Product Version: NetBeans IDE Dev (Build 201309030001)
Updates: Updates available to version NetBeans 7.3 Patch 2
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.0.0-32-generic running on amd64; UTF-8; en_US (nb)

I will try mac os, next time.
Comment 2 sreimers 2013-09-14 10:52:06 UTC
Still valid with NetBeans 7.4RC1 running on top of JDK7u40.
Comment 3 Lou Dasaro 2013-09-14 23:28:02 UTC
On both my Windows 7 and 8 systems, I see in Tools->Options->Keymap that 

Duplicate Line(s) Down	Ctrl+Shift+DOWN	
Move Line(s) Down	Alt+Shift+DOWN

and these key combinations work correctly in the Anagram Game scenario.

Product Version: NetBeans IDE 7.4 RC1 (Build 201309112301)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Comment 4 jxt 2013-10-03 18:31:39 UTC
Happens to me too. Mac OS X 10.8.5, JDK 7u40, i.e., 1.7.0_40-b43. Has been happening for all 7.4 versions I've tried. What's weird is, it doesn't ALWAYS happen. But it does happen often enough to be MADDENING!

This should be a P1 showstopper bug.
Comment 5 jakobl 2013-10-07 14:48:12 UTC
A very annoying bug! I use this feature a lot and it happens most of the time - but not always. I have tried this with java, xml and xsd files all in maven projects.

Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; sv_SE (nb)
Comment 6 Marian Mirilovic 2013-10-07 16:07:32 UTC
Works for me as well on Linux ... so sounds like another Mac specific issue ... 
Product Version: NetBeans IDE 7.4 (Build 201310012201)
Java: 1.7.0_40-ea; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b36
System: Linux version 3.5.0-41-generic running on amd64; UTF-8; en_US (nb)
Comment 7 jakobl 2013-10-07 17:37:39 UTC
(In reply to Marian Mirilovic from comment #6)
> Works for me as well on Linux ... so sounds like another Mac specific issue
> ... 
> Product Version: NetBeans IDE 7.4 (Build 201310012201)
> Java: 1.7.0_40-ea; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
> Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b36
> System: Linux version 3.5.0-41-generic running on amd64; UTF-8; en_US (nb)

You're right Marian!

I just tried it out on my Linux box (with OpenJDK) and it works well. I can't reproduce it.

Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201)
Java: 1.7.0_25; OpenJDK 64-Bit Server VM 23.7-b01
Runtime: OpenJDK Runtime Environment 1.7.0_25-b30
System: Linux version 3.8.0-31-generic running on amd64; UTF-8; en_US (nb)
Comment 8 Marian Mirilovic 2013-10-15 11:30:05 UTC
*** Bug 236716 has been marked as a duplicate of this bug. ***
Comment 9 luba 2013-10-17 12:18:05 UTC
Happens to me too. Very annoying. Especially since the 7.3 and older versions have now become buggy due to installing the newest JDK (7.4 made me do it).

Fix this soon please! This is one of my most used shortcuts!
Comment 10 luba 2013-10-17 12:32:22 UTC
Sorry, forgot to mention my specs:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.7.5 running on x86_64; UTF-8; en_US (nb)

Regards Luba
Comment 11 scauth 2013-10-22 17:48:57 UTC
I can confirm that as well. I'm also on OS X

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)
Comment 12 roben 2013-10-30 13:51:54 UTC
I just got a new mac book and did a clean reinstall of Netbeans and Java without copying my old configuration. The issue seems to be gone now.
Comment 13 luba 2013-10-30 13:55:44 UTC
I changed NOTHING on my system. Absolutely NOTHING. Specs still the same. And yet the bug is gone since a couple of days ... it's magic!

Specs still:
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.7.5 running on x86_64; UTF-8; en_US (nb)
Comment 14 roben 2013-10-30 14:46:39 UTC
A now it's broken again - Netbeans seems to "forget" other shortcuts completely after some time. Restarting Netbeans helps, all shortcuts are back until it loses them again.
Comment 15 jxt 2013-10-30 14:55:29 UTC
I too have seen the problem go away, but only briefly, only to come back. ARGHH.

On the other hand, I just clicked on the notification to "make my IDE up to date" and got 50 patches applied, resulting in 7.4 Development Version. Initial testing indicates that the problem has been fixed, though I won't exactly be comfortable about that until extended testing proves that it is permanently banished instead of only temporarily.
Comment 16 nickroklaus 2013-10-30 18:18:56 UTC
I thought I'd share my work-around routine, however clunky, in hopes maybe it helps determine what's going on.

When I want to use the ctrl-shift move line,
1) open preferences (command-comma)
2) close preferences (esc) 2x

Now I can move lines without duplication until I switch editor tabs again.
Comment 17 squib 2013-10-31 10:08:47 UTC
I experience the same strange behavior on Mac OS 10.8.3 and Netbeans 7.4 (did not happen on NB7.3). Very annoying..

Java 1.7.0_25-b15 64-Bit
Comment 18 roben 2013-10-31 11:04:44 UTC
(In reply to nickroklaus from comment #16)
> I thought I'd share my work-around routine, however clunky, in hopes maybe
> it helps determine what's going on.
> 
> When I want to use the ctrl-shift move line,
> 1) open preferences (command-comma)
> 2) close preferences (esc) 2x
> 
> Now I can move lines without duplication until I switch editor tabs again.

This works for me, too. Thanks! I hope this also helps fixing the bug.
Comment 19 luba 2013-10-31 12:52:53 UTC
(In reply to nickroklaus from comment #16)
> I thought I'd share my work-around routine, however clunky, in hopes maybe
> it helps determine what's going on.
> 
> When I want to use the ctrl-shift move line,
> 1) open preferences (command-comma)
> 2) close preferences (esc) 2x
> 
> Now I can move lines without duplication until I switch editor tabs again.

The errors back in my machine and the above solution does not work for me ;(.
Comment 20 nickroklaus 2013-11-01 14:30:36 UTC
This is another workaround that when followed puts 'Duplicate Line(s) Up/Down' back to the way it to my knowledge worked in 7.3.1. (You loose the more mac-standard 'Extend Selection to Beggining/End of Document' with Shift+Meta+UP/DOWN.)

In Netbeans 7.4 Preferences (Options), Keymap:

(1) Search for dupli... clear shortcuts Alt+Shift+DOWN and Alt+Shift+UP. (At this point, the bug in question is obviated, but you've lost the main shortcut for duplicating lines with the keyboard. If you want that...) 

(2) Search for extend... clear shortcuts Shift+Meta+UP and Shift+Meta+DOWN.

(3) Search for dupli... add alternatives Shift+Meta+DOWN and Shift+Meta+UP for the corresponding Duplicate Line(s) shortcuts.

That's it. If you change your mind, you can always search for the shortcuts and Reset to Default in reverse order. Or, reset to default settings: In the same Keymap tab, click Manage Profiles & then Restore Defaults (NetBeans profile on my list).
Comment 21 luba 2013-11-04 08:34:13 UTC
(In reply to nickroklaus from comment #20)
> This is another workaround that when followed puts 'Duplicate Line(s)
> Up/Down' back to the way it to my knowledge worked in 7.3.1. (You loose the
> more mac-standard 'Extend Selection to Beggining/End of Document' with
> Shift+Meta+UP/DOWN.)
> 
> In Netbeans 7.4 Preferences (Options), Keymap:
> 
> (1) Search for dupli... clear shortcuts Alt+Shift+DOWN and Alt+Shift+UP. (At
> this point, the bug in question is obviated, but you've lost the main
> shortcut for duplicating lines with the keyboard. If you want that...) 
> 
> (2) Search for extend... clear shortcuts Shift+Meta+UP and Shift+Meta+DOWN.
> 
> (3) Search for dupli... add alternatives Shift+Meta+DOWN and Shift+Meta+UP
> for the corresponding Duplicate Line(s) shortcuts.
> 
> That's it. If you change your mind, you can always search for the shortcuts
> and Reset to Default in reverse order. Or, reset to default settings: In the
> same Keymap tab, click Manage Profiles & then Restore Defaults (NetBeans
> profile on my list).

Another bummer: After deleting the Shift+Meta+DOWN and UP showrtcuts i cannot assign these shortcuts anymore. When pressing the up and down arrow in the shortcut assignment field, it just goes up and down in the select box. right and left arrows are recognized, but up and down aren't. And they're not in the select options. This is silly.
Comment 22 patkoscsaba 2013-11-13 12:01:53 UTC
It seems like ctrl+shift+up / ctrl+shift+down is some macos default now. If you assign another combination to the move line action it works. I managed to get all acceptable by setting move line to alt+shift+up/dow and letting crtl+shift+up/down control the duplication. It will take a couple of days to get used to it, and I have to reverse my settings on my home desktop running Linux, too, but it's an acceptable compromise.
Comment 23 jmborer 2013-11-22 10:21:41 UTC
Same for me. CTRL+SHIT+UP just fires navigation in combos... Weird.

(In reply to luba from comment #21)
> (In reply to nickroklaus from comment #20)
> > This is another workaround that when followed puts 'Duplicate Line(s)
> > Up/Down' back to the way it to my knowledge worked in 7.3.1. (You loose the
> > more mac-standard 'Extend Selection to Beggining/End of Document' with
> > Shift+Meta+UP/DOWN.)
> > 
> > In Netbeans 7.4 Preferences (Options), Keymap:
> > 
> > (1) Search for dupli... clear shortcuts Alt+Shift+DOWN and Alt+Shift+UP. (At
> > this point, the bug in question is obviated, but you've lost the main
> > shortcut for duplicating lines with the keyboard. If you want that...) 
> > 
> > (2) Search for extend... clear shortcuts Shift+Meta+UP and Shift+Meta+DOWN.
> > 
> > (3) Search for dupli... add alternatives Shift+Meta+DOWN and Shift+Meta+UP
> > for the corresponding Duplicate Line(s) shortcuts.
> > 
> > That's it. If you change your mind, you can always search for the shortcuts
> > and Reset to Default in reverse order. Or, reset to default settings: In the
> > same Keymap tab, click Manage Profiles & then Restore Defaults (NetBeans
> > profile on my list).
> 
> Another bummer: After deleting the Shift+Meta+DOWN and UP showrtcuts i
> cannot assign these shortcuts anymore. When pressing the up and down arrow
> in the shortcut assignment field, it just goes up and down in the select
> box. right and left arrows are recognized, but up and down aren't. And
> they're not in the select options. This is silly.
Comment 24 jmborer 2013-11-22 10:23:20 UTC
I've got the same issue: CTRL+SHIT+UP moves the selected block and then duplicates it! Strange. I double checked my Mac OS Mavericks shortcuts, but this combination seems not to be assigned to any function.
Comment 25 jmborer 2013-11-22 10:24:00 UTC
Oh and the suggested work arounds above did not work. Only reassign another combination will work...
(In reply to jmborer from comment #24)
> I've got the same issue: CTRL+SHIT+UP moves the selected block and then
> duplicates it! Strange. I double checked my Mac OS Mavericks shortcuts, but
> this combination seems not to be assigned to any function.
Comment 26 Miloslav Metelka 2013-12-05 13:28:16 UTC
I have searched over internet and found that there should be Ctrl+Up assigned (in System Preferences -> Keyboard -> Keyboard Shortcuts) to "Mission Control" and Shift is generally causing a slow motion of the feature (on Snow Leopard; similar for Shift+expose etc.). So remapping the "Mission Control" from Ctrl+Up should also free the Ctrl+Shift+Up.
Could anyone please try this? Thanks.
Comment 27 jxt 2013-12-05 14:51:21 UTC
(In reply to Miloslav Metelka from comment #26)
> I have searched over internet and found that there should be Ctrl+Up
> assigned (in System Preferences -> Keyboard -> Keyboard Shortcuts) to
> "Mission Control" and Shift is generally causing a slow motion of the
> feature (on Snow Leopard; similar for Shift+expose etc.). So remapping the
> "Mission Control" from Ctrl+Up should also free the Ctrl+Shift+Up.
> Could anyone please try this? Thanks.

That does not help. I have and have always had Ctrl-Up unmapped in System Preferences, purely because I want to use [Shift] Ctrl-Up/Down in NetBeans. Worked in 7.3. Something changed in 7.4, including the betas.
Comment 28 ionuion 2013-12-05 15:14:43 UTC
I had Mission Control (Ctrl-up) and Application Windows (Ctrl-down) disabled as well, however I gave it a try and remapped them to Cmd-/ and Cmd-\, respectively.
Left them active, checked that they worked.

The problem persists in Netbeans. Line duplicated upon moving with Ctrl-Shift-Up/Down

Environment:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b59
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b117
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)

(In reply to Miloslav Metelka from comment #26)
> I have searched over internet and found that there should be Ctrl+Up
> assigned (in System Preferences -> Keyboard -> Keyboard Shortcuts) to
> "Mission Control" and Shift is generally causing a slow motion of the
> feature (on Snow Leopard; similar for Shift+expose etc.). So remapping the
> "Mission Control" from Ctrl+Up should also free the Ctrl+Shift+Up.
> Could anyone please try this? Thanks.
Comment 29 mpilone 2013-12-05 15:32:42 UTC
It appears to be some kind of interaction between the "Move Line(s) ..." and the "Duplicate Line(s) ...". For example, with default bindings:

Move Line(s) Down: Ctrl+Shift+DOWN
Move Line(s) Down (alt): Ctrl+Shift+KP_DOWN

Duplicate Line(s) Down: Alt+Shift+KP_DOWN
Duplicate Line(s) Down (alt): Alt+Shift+DOWN

I get duplicate lines when using the move functionality. However with bindings:

Move Line(s) Down: Ctrl+Shift+DOWN
Move Line(s) Down (alt): Ctrl+Shift+KP_DOWN

Duplicate Line(s) Down: 
Duplicate Line(s) Down (alt): 

I get proper functionality with the move functionality and obviously duplicate functionality doesn't work. This implies to me that the issue isn't with the Ctrl+Shift+DOWN binding, but somehow the Alt+Shift+DOWN binding is getting triggered when Ctrl is pressed. I wonder if two key press events are being generated or if the check for which metakeys are pressed is too broad in this case?

Is there an easy setup to debug this? I'm willing to give it a shot if you can point me to the general area in the source where the keybindings are applied in the editor.
Comment 30 mpilone 2013-12-10 19:30:33 UTC
I did some debugging and I think I narrowed down the problem a little. The ActionFactory.CopySelectionElseLineDownAction is being fired immediately after the ActionFactory.MoveSelectionElseLineDownAction even when only Ctrl+Shift+DOWN is pressed. Looking at the event modifiers, I can see that the Move action is fired with 195 while the Copy is fired with 585 indicating Ctrl+Shift and Alt+Shift respectively. So as far as the actions are concerned, there were two keystrokes, one with Ctrl and one with Alt even though the Alt combination was never pressed.

Tracking through the stack trace, I think the issue may be because of some code in org.openide.awt.MenuBar.java around line 224. The method, processKeyBinding has the suspicious JavaDoc:

    * Overridden to handle mac conversion from Alt to Ctrl and vice versa so
    * Alt can be used as the compose character on international keyboards.

In the method, if Ctrl is pressed and Alt isn't, the modifiers are modified around line 237 to remove Ctrl and add Alt. Even more strange, around line 254 the isOnKeyRelease is negated meaning the original key up with Ctrl pressed event now appears as a key down Alt pressed event.

I barely know this code so I'm not sure why it is being done, but this appears to be the root of why both Copy and Move actions are getting fired. The issue only seems to appear when a second editor is open and remains until the IDE is restarted. So maybe the MenuBar code is correct but something about opening a second editor causes the MenuBar to listen for events it shouldn't be handling.
Comment 31 jxt 2013-12-10 19:55:01 UTC
> I barely know this code so I'm not sure why it is being done, but this
> appears to be the root of why both Copy and Move actions are getting fired.
> The issue only seems to appear when a second editor is open and remains
> until the IDE is restarted. So maybe the MenuBar code is correct but
> something about opening a second editor causes the MenuBar to listen for
> events it shouldn't be handling.

Hey, this is great news because
a) someone is working on it, and
b) it seems like you're close to identifying the source of the problem

As an additional hint, however, I would remind you that, as someone else here discovered, opening and closing preferences (Command-comma, escape, escape) also fixes the problem for a while. I have not noticed just what circumstance causes the problem to reappear, but perhaps it is opening another editor tab. In any case, the problem does not necessarily remain until the IDE is restarted, as it can be, at least temporarily, fixed with the open/close preferences trick.

Thanks for working on this maddening problem.
Comment 32 mpilone 2013-12-11 22:17:47 UTC
Well I wouldn't really say I'm working on the issue but I am trying to gather some more information so someone who knows this code can hopefully provide a fix.

It looks like the extra, fake keystroke I described earlier is fired in both the working and broken case. The code to fire that event has been around for a number of years according to SCM logs.

What's different is that in the working case, the key binding for the fake Alt+Shift+Down is not found in the MainMenuAction when the MenuBar is processing the key stroke. In the broken case, the key binding is fired and the action is fired. I stepped through the code a few times but I didn't see any obvious reason why the binding was found in one case but not in the other.

You're right that opening and canceling the preferences dialog resolves the problem. It looks like the menu system is based on some kind of lazy action loading framework so I'm wondering if opening the preferences clears the menu items which causes the keybinding to not be found until something like opening another editor causes the menu items to be lazily loaded and the key binding is found from that point on.

I'm not making too much progress but hopefully someone will find this information useful!
Comment 33 mpilone 2013-12-12 14:49:13 UTC
Some more information but still no solution: I can get this to happen with other actions defined in the ActionFactory. For example, with the bindings:

Move Line(s) Down: Ctrl+Shift+DOWN
Shift Line Right: Alt+Shift+DOWN

I get the same broken behavior where the line moves and then shifts when Ctrl+Shift+DOWN is pressed. Again, it is the MenuBar applying the hack/fix for Macs where the Ctrl modified is converted to an Alt modifier and reprocessed.

The issue doesn't show up with actions defined in ActionFactory that don't appear in the menu. For example, Extend Selection To First Non-whitespace Char. So The issue is related to the key bindings on menu items.

Interestingly, the issue also doesn't appear if I assign the Alt+Shift+DOWN binding to "Find..." which does appear in the menu but not in the ActionFactory. Looking in the Debugger is looks like that menu item extends Action while the others that do fire extend MainMenuAction. So maybe there is a difference in how these actions are handling the keybindings.

As pointed out, opening and closing the preferences window restores sanity for a little while. I also found that just opening the Find bar (Cmd+F) does the same.
Comment 34 jmborer 2013-12-12 14:53:52 UTC
So question is: what did change in the shortcut and action code between 7.3 and 7.4?

PS: Thanks mpilone for your investigations
Comment 35 Miloslav Metelka 2013-12-17 14:27:31 UTC
I have added two loggers for possible tracking of the problem:
-J-Dorg.openide.awt.MenuBar.level=FINE
-J-Dorg.netbeans.editor.MultiKeymap.level=FINE

http://hg.netbeans.org/jet-main/rev/15ed5385984b

Could someone please edit netbeans.conf and run the IDE with

-J-Dapple.laf.useScreenMenuBar=false

whether that makes any difference on the problem or not? (the default is -J-Dapple.laf.useScreenMenuBar=true in netbeans.conf). Thanks.
Comment 36 jxt 2013-12-17 15:22:58 UTC
> Could someone please edit netbeans.conf and run the IDE with
> 
> -J-Dapple.laf.useScreenMenuBar=false

I did that, by editing /Applications/NetBeans/NetBeans 7.4.app/Contents/Resources/NetBeans/etc/netbeans.conf

No change. Problem is still there. No obvious difference in behavior elsewhere, but I guess I'll change it back now.
Comment 37 mpilone 2013-12-17 18:20:43 UTC
Created attachment 143268 [details]
Log capture using the extended menubar logging.

I attempted to checkout the code from Mercurial but it was taking for ever so I just applied the two changed files over my 7.4 source tar ball. The log includes a period of the issue showing then I opened the preferences window which causes the issue to go away. I only ever typed CTRL+SHIFT+UP/DOWN and never the ALT combination directly. Let me know if you need more information.
Comment 38 mpilone 2013-12-17 18:47:10 UTC
Created attachment 143269 [details]
Log capture with fine menubar and action logging.

I added log statements to the CopySelectionElseLineUpAction and MoveSelectionElseLineUpAction to show the duplicate firing. Again, I only used the CTRL +SHIFT+UP/DOWN shortcut but both actions are fired. I also opened the preferences dialog near the end of the log and the issue resolves temporarily.

The command used was:
./netbeans -J-Dorg.openide.awt.MenuBar.level=FINE -J-Dorg.netbeans.editor.MultiKeymap.level=FINE -J-Dorg.netbeans.editor.ActionFactory.level=FINE --userdir ~/tmp/netbeans-debug/
Comment 39 Miloslav Metelka 2013-12-18 11:37:16 UTC
(In reply to mpilone from comment #38)
> Created attachment 143269 [details]
> Log capture with fine menubar and action logging.
> 
> I added log statements to the CopySelectionElseLineUpAction and
> MoveSelectionElseLineUpAction to show the duplicate firing. Again, I only
> used the CTRL +SHIFT+UP/DOWN shortcut but both actions are fired. I also
> opened the preferences dialog near the end of the log and the issue resolves
> temporarily.
> 
> The command used was:
> ./netbeans -J-Dorg.openide.awt.MenuBar.level=FINE
> -J-Dorg.netbeans.editor.MultiKeymap.level=FINE
> -J-Dorg.netbeans.editor.ActionFactory.level=FINE --userdir
> ~/tmp/netbeans-debug/

Thanks a lot for the testing. The expected MoveSelectionElseLineUpAction triggers normally through the MultiKeymap as expected. The extra CopySelectionElseLineUpAction is a result of the MenuBar translation. It's not clear to me why it's necessary to translate the events when there are already extra modifiers (e.g. 'D' instead of 'C') that should already serve for that purpose too - javadoc says "Alt can be used as the compose character on international keyboards" but IMHO input methods should capture such input prior key binding processing anyway but I may be missing something here. Reassigning to platform/windows for further evaluation.
Comment 40 Stanislav Aubrecht 2013-12-18 12:36:46 UTC
It seems that the ctrl <-> alt translation hack is no longer needed so I removed it in core-main d2293d9ae769

Please reopen or file a new bug if you encounter any weird keyboard shortcut behavior on Mac with this fix.
Comment 41 Quality Engineering 2013-12-19 03:14:24 UTC
Integrated into 'main-silver', will be available in build *201312190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/15ed5385984b
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #235288 - Move Line(s) Up/Down duplicates line - added two loggers.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo