# NetBeans IDE HG Patch # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\ws\core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java --- editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java +++ editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java @@ -2359,9 +2359,10 @@ } private boolean isLeftMouseButtonExt(MouseEvent evt) { + // like in org.netbeans.editor.BaseCaret.isLeftMouseButtonExt(MouseEvent) return (SwingUtilities.isLeftMouseButton(evt) && !(evt.isPopupTrigger()) - && (evt.getModifiers() & (InputEvent.META_MASK/* | InputEvent.ALT_MASK*/)) == 0); + && (evt.getModifiers() & (InputEvent.META_MASK | InputEvent.ALT_MASK)) == 0); } private boolean isMiddleMouseButtonExt(MouseEvent evt) { @@ -2684,7 +2685,7 @@ c.requestFocus(); } c.setDragEnabled(true); - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { mouseState = MouseState.CHAR_SELECTION; try { Position pos = doc.createPosition(offset); @@ -2719,7 +2720,7 @@ foldExpanded = caretFoldExpander.checkExpandFold(c, evt.getPoint()); } if (!foldExpanded) { - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { try { int begOffs = Utilities.getWordStart(c, offset); int endOffs = Utilities.getWordEnd(c, offset); @@ -2754,7 +2755,7 @@ mouseState = MouseState.LINE_SELECTION; // Disable drag which would otherwise occur when mouse would be over text c.setDragEnabled(false); - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { try { int begOffs = Utilities.getRowStart(c, offset); int endOffs = Utilities.getRowEnd(c, offset); @@ -2789,6 +2790,13 @@ } } + private boolean isControlShiftDown(MouseEvent mouseEvent) { + boolean ctrlDown = org.openide.util.Utilities.isMac() ? mouseEvent.isMetaDown() + : mouseEvent.isControlDown(); + boolean shiftDown = mouseEvent.isShiftDown(); + return ctrlDown && shiftDown; + } + @Override public void mouseReleased(MouseEvent evt) { if (LOG.isLoggable(Level.FINE)) { @@ -2844,7 +2852,7 @@ JTextComponent c = component; if (c != null) { - if (evt.getClickCount() == 1 && evt.isControlDown() && evt.isShiftDown()) { + if (evt.getClickCount() == 1 && isControlShiftDown(evt)) { evt.consume(); // consume event already handled by mousePressed } if (isMiddleMouseButtonExt(evt)) {