Index: /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapController.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapController.java	(revision 19453)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapController.java	(revision 19454)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.bbox;
 
+import java.awt.KeyboardFocusManager;
 import java.awt.Point;
 import java.awt.event.ActionEvent;
@@ -17,4 +18,5 @@
 import javax.swing.JPanel;
 import javax.swing.KeyStroke;
+import javax.swing.text.JTextComponent;
 
 import org.openstreetmap.josm.tools.PlatformManager;
@@ -93,16 +95,23 @@
         // zooming. To avoid confusion about which modifier key to use,
         // we just add all keys left of the space bar
+        //
+        // Typing the '+', '=', or '-' character in the Overpass query field
+        // seems to trigger these key bindings, which would zoom the map
+        // (https://josm.openstreetmap.de/ticket/24392). To prevent that, those
+        // keys use a special version of the action that does nothing if a text
+        // field is focused. That feels like a hack, but we didn't find an
+        // obvious better way.
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_DOWN_MASK, false), "ZOOM_IN");
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.META_DOWN_MASK, false), "ZOOM_IN");
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_DOWN_MASK, false), "ZOOM_IN");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0, false), "ZOOM_IN");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0, false), "ZOOM_IN");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, 0, false), "ZOOM_IN");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.SHIFT_DOWN_MASK, false), "ZOOM_IN");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0, false), "ZOOM_IN_UNLESS_TYPING");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0, false), "ZOOM_IN_UNLESS_TYPING");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, 0, false), "ZOOM_IN_UNLESS_TYPING");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.SHIFT_DOWN_MASK, false), "ZOOM_IN_UNLESS_TYPING");
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_DOWN_MASK, false), "ZOOM_OUT");
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.META_DOWN_MASK, false), "ZOOM_OUT");
         inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_DOWN_MASK, false), "ZOOM_OUT");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0, false), "ZOOM_OUT");
-        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, 0, false), "ZOOM_OUT");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0, false), "ZOOM_OUT_UNLESS_TYPING");
+        inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, 0, false), "ZOOM_OUT_UNLESS_TYPING");
 
         // action mapping
@@ -113,6 +122,8 @@
         actionMap.put("STOP_MOVE_HORIZONTALLY", new MoveXAction(0));
         actionMap.put("STOP_MOVE_VERTICALLY", new MoveYAction(0));
-        actionMap.put("ZOOM_IN", new ZoomInAction());
-        actionMap.put("ZOOM_OUT", new ZoomOutAction());
+        actionMap.put("ZOOM_IN", new ZoomInAction(false));
+        actionMap.put("ZOOM_IN_UNLESS_TYPING", new ZoomInAction(true));
+        actionMap.put("ZOOM_OUT", new ZoomOutAction(false));
+        actionMap.put("ZOOM_OUT_UNLESS_TYPING", new ZoomOutAction(true));
     }
 
@@ -301,8 +312,20 @@
     }
 
+    static boolean isTyping() {
+        return KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() instanceof JTextComponent;
+    }
+
     private final class ZoomInAction extends AbstractAction {
 
+        private boolean suppressWhileTyping;
+
+        ZoomInAction(boolean suppressWhileTyping) {
+            this.suppressWhileTyping = suppressWhileTyping;
+        }
+
         @Override
         public void actionPerformed(ActionEvent e) {
+            if (suppressWhileTyping && isTyping())
+                return;
             iSlippyMapChooser.zoomIn();
         }
@@ -311,6 +334,14 @@
     private final class ZoomOutAction extends AbstractAction {
 
+        private boolean suppressWhileTyping;
+
+        ZoomOutAction(boolean suppressWhileTyping) {
+            this.suppressWhileTyping = suppressWhileTyping;
+        }
+
         @Override
         public void actionPerformed(ActionEvent e) {
+            if (suppressWhileTyping && isTyping())
+                return;
             iSlippyMapChooser.zoomOut();
         }
