Browse Source

fixes issue 2085: ctrl+enter broken in csd/paste dialog

tags/0.6.3m1rc1
Gregory Holmes 15 years ago
parent
commit
3ca2f81826

+ 2
- 1
src/com/dmdirc/addons/ui_swing/components/SwingInputHandler.java View File

@@ -216,7 +216,8 @@ public class SwingInputHandler extends InputHandler implements KeyListener {
216 216
         if (e.getKeyCode() != KeyEvent.VK_TAB && e.getKeyCode() !=
217 217
                 KeyEvent.VK_UP && e.getKeyCode() != KeyEvent.VK_DOWN) {
218 218
             final String line = target.getText();
219
-            if (UIUtilities.isCtrlDown(e) && e.getKeyCode() == KeyEvent.VK_ENTER) {
219
+            if (UIUtilities.isCtrlDown(e) && e.getKeyCode() == KeyEvent.VK_ENTER
220
+                    && (flags & HANDLE_RETURN) == HANDLE_RETURN) {
220 221
                 target.setText("");
221 222
             }
222 223
             SwingUtilities.invokeLater(new Runnable() {

+ 6
- 6
src/com/dmdirc/ui/input/InputHandler.java View File

@@ -67,17 +67,17 @@ public abstract class InputHandler implements ConfigChangeListener {
67 67
      * Indicates that the caret should be moved to the start of a selection when
68 68
      * a control code has been inserted.
69 69
      */
70
-    private static final int POSITION_START = 2;
70
+    protected static final int POSITION_START = 2;
71 71
     /** Flag to indicate that this input handler should handle tab completion. */
72
-    private static final int HANDLE_TABCOMPLETION = 1;
72
+    protected static final int HANDLE_TABCOMPLETION = 1;
73 73
     /** Flag to indicate that this input handler should maintain a back buffer. */
74
-    private static final int HANDLE_BACKBUFFER = 2;
74
+    protected static final int HANDLE_BACKBUFFER = 2;
75 75
     /** Flag to indicate that this input handler should handle formatting. */
76
-    private static final int HANDLE_FORMATTING = 4;
76
+    protected static final int HANDLE_FORMATTING = 4;
77 77
     /** Flag to indicate that this input handler should handle returns. */
78
-    private static final int HANDLE_RETURN = 8;
78
+    protected static final int HANDLE_RETURN = 8;
79 79
     /** The flags for this particular input handler. */
80
-    private int flags = HANDLE_TABCOMPLETION | HANDLE_BACKBUFFER
80
+    protected int flags = HANDLE_TABCOMPLETION | HANDLE_BACKBUFFER
81 81
             | HANDLE_FORMATTING | HANDLE_RETURN;
82 82
     /** The input buffer. */
83 83
     protected RollingList<String> buffer;

Loading…
Cancel
Save