Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 1408)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 1409)
@@ -66,7 +66,11 @@
     private boolean alt;
     private boolean shift;
-    private boolean mouseOnExistingNode;
+    private Node mouseOnExistingNode;
+    private Set<Way> mouseOnExistingWays = new HashSet<Way>();
+    private Set<OsmPrimitive> oldHighlights = new HashSet<OsmPrimitive>();
     private boolean drawHelperLine;
     private boolean wayIsFinished = false;
+    private boolean drawTargetHighlight;
+    private boolean drawTargetCursor;
     private Point mousePos;
     private Color selectedColor;
@@ -93,14 +97,96 @@
     }
 
+    /**
+     * Sets a special cursor to indicate that the next click will automatically join into
+     * an existing node or way (if feature is enabled)
+     *
+     * @param way If true, the cursor will indicate it is joined into a way; node otherwise
+     */
+    private void setJoinCursor(boolean way) {
+        if(!drawTargetCursor) {
+            resetCursor();
+            return;
+        }
+        try {
+            Main.map.mapView.setCursor(
+                    ImageProvider.getCursor("crosshair", (way ? "joinway" : "joinnode"))
+            );
+            return;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        resetCursor();
+    }
+
+    /**
+     * Resets the cursor to the default cursor for drawing mode (i.e. crosshair)
+     */
+    private void resetCursor() {
+        Main.map.mapView.setCursor(getCursor());
+    }
+
+    /**
+     * Takes the data from computeHelperLine to determine which ways/nodes should be highlighted
+     * (if feature enabled). Also sets the target cursor if appropriate.
+     */
+    private void addHighlighting() {
+        // if ctrl key is held ("no join"), don't highlight anything
+        if (ctrl) {
+            removeHighlighting();
+            resetCursor();
+            return;
+        }
+
+        if (mouseOnExistingNode != null) {
+            setJoinCursor(false);
+            // Clean old highlights
+            removeHighlighting();
+            if(drawTargetHighlight) {
+                oldHighlights.add(mouseOnExistingNode);
+                mouseOnExistingNode.highlighted = true;
+            }
+            return;
+        }
+
+        // Insert the node into all the nearby way segments
+        if(mouseOnExistingWays.size() == 0) {
+            removeHighlighting();
+            resetCursor();
+            return;
+        }
+
+        setJoinCursor(true);
+        // Clean old highlights
+        removeHighlighting();
+
+        if(!drawTargetHighlight) return;
+        oldHighlights.addAll(mouseOnExistingWays);
+        for(Way w : mouseOnExistingWays) {
+            w.highlighted = true;
+        }
+    }
+
+    /**
+     * Removes target highlighting from primitives
+     */
+    private void removeHighlighting() {
+        for(OsmPrimitive prim : oldHighlights) {
+            prim.highlighted = false;
+        }
+    }
+
     @Override public void enterMode() {
         super.enterMode();
         selectedColor = Main.pref.getColor(marktr("selected"), Color.red);
         drawHelperLine = Main.pref.getBoolean("draw.helper-line", true);
+        drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true);
+        drawTargetCursor = Main.pref.getBoolean("draw.target-cursor", true);
         wayIsFinished = false;
-        
+
         Main.map.mapView.addMouseListener(this);
         Main.map.mapView.addMouseMotionListener(this);
         Main.map.mapView.addTemporaryLayer(this);
         DataSet.selListeners.add(this);
+
         try {
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
@@ -110,4 +196,5 @@
         // computeHelperLine(false, false, false);
     }
+
     @Override public void exitMode() {
         super.exitMode();
@@ -116,4 +203,5 @@
         Main.map.mapView.removeTemporaryLayer(this);
         DataSet.selListeners.remove(this);
+        removeHighlighting();
         try {
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
@@ -147,5 +235,5 @@
         mouseClicked(e);
     }
-    
+
     /**
      * If user clicked with the left button, add a node at the current mouse
@@ -184,5 +272,5 @@
         if (!ctrl)
             n = Main.map.mapView.getNearestNode(mousePos);
-      
+
         if (n != null) {
             // user clicked on node
@@ -259,5 +347,5 @@
             Node selectedNode = null;
             Way selectedWay = null;
-            
+
             for (OsmPrimitive p : selection) {
                 if (p instanceof Node) {
@@ -277,5 +365,5 @@
                 }
             }
-            
+
             // No nodes or ways have been selected, try again with no selection
             // This occurs when a relation has been selected
@@ -292,5 +380,5 @@
                     n0 = lastUsedNode;
                 } else {
-                    // We have a way selected, but no suitable node to continue from. Start anew. 
+                    // We have a way selected, but no suitable node to continue from. Start anew.
                     tryAgain(e);
                     return;
@@ -326,5 +414,5 @@
                 }
             }
-            
+
             // User clicked last node again, finish way
             if(n0 == n) {
@@ -379,5 +467,5 @@
             Main.ds.setSelected(way);
         }
-      
+
         String title;
         if (!extendedWay) {
@@ -404,4 +492,5 @@
         if(!wayIsFinished) lastUsedNode = n;
         computeHelperLine();
+        removeHighlighting();
         Main.map.mapView.repaint();
     }
@@ -420,4 +509,5 @@
         mousePos = e.getPoint();
 
+        addHighlighting();
         computeHelperLine();
     }
@@ -444,5 +534,6 @@
         Way selectedWay = null;
         Node currentMouseNode = null;
-        mouseOnExistingNode = false;
+        mouseOnExistingNode = null;
+        mouseOnExistingWays = new HashSet<Way>();
 
         Main.map.statusLine.setAngle(-1);
@@ -452,4 +543,12 @@
         if (!ctrl && mousePos != null) {
             currentMouseNode = Main.map.mapView.getNearestNode(mousePos);
+        }
+
+        // We need this for highlighting and we'll only do so if we actually want to re-use
+        // *and* there is no node nearby (because nodes beat ways when re-using)
+        if(!ctrl && currentMouseNode == null) {
+            List<WaySegment> wss = Main.map.mapView.getNearestWaySegments(mousePos);
+            for(WaySegment ws : wss)
+                mouseOnExistingWays.add(ws.way);
         }
 
@@ -458,5 +557,5 @@
             if (selection.isEmpty()) return;
             currentMouseEastNorth = currentMouseNode.eastNorth;
-            mouseOnExistingNode = true;
+            mouseOnExistingNode = currentMouseNode;
         } else {
             // no node found in clicked area
@@ -511,6 +610,5 @@
         updateStatusLine();
 
-        if (!drawHelperLine || wayIsFinished) return;
-
+        if ((!drawHelperLine || wayIsFinished) && !drawTargetHighlight) return;
         Main.map.mapView.repaint();
     }
@@ -640,7 +738,5 @@
 
     public void paint(Graphics g, MapView mv) {
-
-        // don't draw line if disabled in prefs
-        if (!drawHelperLine) return;
+        if (!drawHelperLine && !drawTargetHighlight) return;
 
         // sanity checks
@@ -652,6 +748,5 @@
 
         // don't draw line if we don't know where from or where to
-        if (currentBaseNode == null) return;
-        if (currentMouseEastNorth == null) return;
+        if (currentBaseNode == null || currentMouseEastNorth == null) return;
 
         // don't draw line if mouse is outside window
@@ -677,5 +772,4 @@
         g2.draw(b);
         g2.setStroke(new BasicStroke(1));
-
     }
 
@@ -684,5 +778,5 @@
 
         if (currentBaseNode != null && !shift) {
-            if (mouseOnExistingNode) {
+            if (mouseOnExistingNode != null) {
                 if (alt && /* FIXME: way exists */true)
                     rv = tr("Click to create a new way to the existing node.");
@@ -704,5 +798,5 @@
         return rv.toString();
     }
-    
+
     @Override public boolean layerIsSupported(Layer l) {
         return l instanceof OsmDataLayer;
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 1408)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 1409)
@@ -123,4 +123,10 @@
      */
     public volatile boolean selected = false;
+    
+    /**
+     * If set to true, this object is highlighted. Currently this is only used to
+     * show which ways/nodes will connect 
+     */
+    public volatile boolean highlighted = false;
 
     /**
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1408)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 1409)
@@ -120,6 +120,5 @@
         if(osm.mappaintStyle == null && styles != null) {
             osm.mappaintStyle = styles.get(osm);
-            if(osm instanceof Way)
-                osm.isMappaintArea = styles.isArea(osm);
+            osm.isMappaintArea = styles.isArea(osm);
         }
         return osm.isMappaintArea;
@@ -151,4 +150,6 @@
         if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist)
             drawNode(n, nodeStyle.icon, nodeStyle.annotate, n.selected);
+        else if (n.highlighted)
+            drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
         else if (n.selected)
             drawNode(n, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
@@ -266,5 +267,8 @@
             if (tmpWidth > width) width = tmpWidth;
         }
-        if(w.selected)
+
+        if(w.highlighted)
+            color = highlightColor;
+        else if(w.selected)
             color = selectedColor;
 
@@ -1136,5 +1140,5 @@
                 g2d.draw(currentPath);
             }
-            
+
             if(useStrokes > dist)
                 g2d.setStroke(new BasicStroke(1));
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 1408)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 1409)
@@ -37,4 +37,5 @@
     public final static Color darkgreen = new Color(0,128,0);
     public final static Color teal = new Color(0,128,128);
+    public final static Color lightteal= new Color(0, 255, 186);
 
     /**
@@ -62,4 +63,5 @@
     protected Color incompleteColor;
     protected Color backgroundColor;
+    protected Color highlightColor;
     protected boolean showDirectionArrow;
     protected boolean showRelevantDirectionsOnly;
@@ -97,4 +99,5 @@
         incompleteColor = Main.pref.getColor(marktr("incomplete way"), darkerblue);
         backgroundColor = Main.pref.getColor(marktr("background"), Color.BLACK);
+        highlightColor = Main.pref.getColor(marktr("highlight"), lightteal);
     }
 
@@ -132,11 +135,11 @@
 
         getSettings(virtual);
-        
-        if(profiler) 
+
+        if(profiler)
         {
             System.out.format("Prepare  : %4dms\n", (java.lang.System.currentTimeMillis()-profilerLast));
             profilerLast = java.lang.System.currentTimeMillis();
         }
-        
+
         // draw tagged ways first, then untagged ways. takes
         // time to iterate through list twice, OTOH does not
@@ -245,4 +248,6 @@
         if (inactive)
             drawNode(n, inactiveColor, unselectedNodeSize, unselectedNodeRadius, fillUnselectedNode);
+        else if (n.highlighted)
+            drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
         else if (n.selected)
             drawNode(n, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
@@ -301,4 +306,8 @@
         if (inactive) {
             wayColor = inactiveColor;
+        } else if(w.highlighted) {
+            wayColor = highlightColor;
+        } else if(w.selected) {
+            wayColor = selectedColor;
         } else if (!w.tagged) {
             wayColor = untaggedWayColor;
@@ -312,5 +321,5 @@
             for (int orderNumber = 1; it.hasNext(); orderNumber++) {
                 Point p = nc.getPoint(it.next().eastNorth);
-                drawSegment(lastP, p, w.selected && !inactive ? selectedColor : wayColor, 
+                drawSegment(lastP, p, wayColor,
                     showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow);
                 if (showOrderNumber)
