Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5092)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5093)
@@ -268,4 +268,25 @@
     }
 
+    private boolean repaintIfRequired(HashSet<OsmPrimitive> newHighlights) {
+        if(!drawTargetHighlight)
+            return false;
+
+        boolean needsRepaint = false;
+        for(OsmPrimitive x : newHighlights) {
+            if(oldHighlights.contains(x)) {
+                continue;
+            }
+            needsRepaint = true;
+            x.setHighlighted(true);
+        }
+        oldHighlights.removeAll(newHighlights);
+        for(OsmPrimitive x : oldHighlights) {
+            x.setHighlighted(false);
+            needsRepaint = true;
+        }
+        oldHighlights = newHighlights;
+        return needsRepaint;
+    }
+
     /**
      * handles adding highlights and updating the cursor for the given mouse event.
@@ -286,6 +307,4 @@
      */
     private boolean giveUserFeedback(MouseEvent e, int modifiers) {
-        boolean needsRepaint = false;
-
         Collection<OsmPrimitive> c = MapView.asColl(
                 mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, true));
@@ -294,7 +313,5 @@
         determineMapMode(!c.isEmpty());
 
-        if(drawTargetHighlight) {
-            needsRepaint = removeHighlighting();
-        }
+        HashSet<OsmPrimitive> newHighlights = new HashSet<OsmPrimitive>();
 
         virtualWays.clear();
@@ -302,10 +319,10 @@
         if(mode == Mode.move && setupVirtual(e)) {
             DataSet ds = getCurrentDataSet();
-            if (ds != null) {
-                if(drawTargetHighlight) ds.setHighlightedVirtualNodes(virtualWays);
+            if (ds != null && drawTargetHighlight) {
+                ds.setHighlightedVirtualNodes(virtualWays);
             }
             mv.setNewCursor(SelectActionCursor.virtual_node.cursor(), this);
             // don't highlight anything else if a virtual node will be
-            return drawTargetHighlight; // if no highlighting, repaint is not needed
+            return repaintIfRequired(newHighlights);
         }
 
@@ -314,5 +331,5 @@
         // return early if there can't be any highlights
         if(!drawTargetHighlight || mode != Mode.move || c.isEmpty())
-            return needsRepaint;
+            return repaintIfRequired(newHighlights);
 
         // CTRL toggles selection, but if while dragging CTRL means merge
@@ -323,9 +340,8 @@
             // we are in toggle mode.
             if(isToggleMode || !x.isSelected()) {
-                x.setHighlighted(true);
-                oldHighlights.add(x);
-            }
-        }
-        return needsRepaint || !oldHighlights.isEmpty();
+                newHighlights.add(x);
+            }
+        }
+        return repaintIfRequired(newHighlights);
     }
 
