Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 6544)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 6546)
@@ -51,4 +51,5 @@
 import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
+import org.openstreetmap.josm.actions.mapmode.DrawAction;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.actions.search.SearchAction;
@@ -60,4 +61,5 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.PrimitiveDeepCopy;
 import org.openstreetmap.josm.data.projection.Projection;
@@ -591,4 +593,23 @@
         return getEditLayer().data;
     }
+    
+    /**
+     * Replies the current selected primitives, from a end-user point of view.
+     * It is not always technically the same collection of primitives than {@link DataSet#getSelected()}.
+     * Indeed, if the user is currently in drawing mode, only the way currently being drawn is returned,
+     * see {@link DrawAction#getInProgressSelection()}.
+     * 
+     * @return The current selected primitives, from a end-user point of view. Can be {@code null}.
+     * @since 6546
+     */
+    public Collection<OsmPrimitive> getInProgressSelection() {
+        if (map != null && map.mapMode instanceof DrawAction) {
+            return ((DrawAction) map.mapMode).getInProgressSelection();
+        } else {
+            DataSet ds = getCurrentDataSet();
+            if (ds == null) return null;
+            return ds.getSelected();
+        }
+    }
 
     /**
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6544)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 6546)
@@ -186,5 +186,5 @@
                 needsRepaint = true;
             } else if (!alt && continueFrom != null && !continueFrom.isSelected()) {
-                addRemoveSelection(currentDataSet, continueFrom, currentBaseNode);
+                currentDataSet.addSelected(continueFrom);
                 needsRepaint = true;
             }
@@ -1256,7 +1256,7 @@
      *
      * While drawing a way, technically the last node is selected.
-     * This is inconvenient when the user tries to add tags to the
-     * way using a keyboard shortcut. In that case, this method returns
-     * the current way as selection, to work around this issue.
+     * This is inconvenient when the user tries to add/edit tags to the way.
+     * For this case, this method returns the current way as selection,
+     * to work around this issue.
      * Otherwise the normal selection of the current data layer is returned.
      */
@@ -1266,5 +1266,5 @@
         if (currentBaseNode != null && !ds.getSelected().isEmpty()) {
             Way continueFrom = getWayForNode(currentBaseNode);
-            if (alt && continueFrom != null)
+            if (continueFrom != null)
                 return Collections.<OsmPrimitive>singleton(continueFrom);
         }
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 6544)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 6546)
@@ -942,5 +942,5 @@
 
         /**
-         * Determine prmitive to be selected and build cycleList
+         * Determine primitive to be selected and build cycleList
          * @param nearest primitive found by simple method
          * @param p point where user clicked
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6544)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6546)
@@ -212,6 +212,5 @@
         @Override public Collection<OsmPrimitive> getSelection() {
             if (Main.main == null) return null;
-            if (Main.main.getCurrentDataSet() == null) return null;
-            return Main.main.getCurrentDataSet().getSelected();
+            return Main.main.getInProgressSelection();
         }
     };
@@ -499,9 +498,6 @@
      */
     private void updateSelection() {
-        if (Main.main.getCurrentDataSet() == null) {
-            selectionChanged(Collections.<OsmPrimitive>emptyList());
-        } else {
-            selectionChanged(Main.main.getCurrentDataSet().getSelected());
-        }
+        // Parameter is ignored in this class
+        selectionChanged(null);
     }
 
@@ -535,5 +531,5 @@
         super.setVisible(b);
         if (b && Main.main.getCurrentDataSet() != null) {
-            selectionChanged(Main.main.getCurrentDataSet().getSelected());
+            updateSelection();
         }
     }
@@ -560,4 +556,10 @@
         if (tagTable.getCellEditor() != null) {
             tagTable.getCellEditor().cancelCellEditing();
+        }
+        
+        // Discard parameter as we do not want to operate always on real selection here, especially in draw mode
+        newSelection = Main.main.getInProgressSelection();
+        if (newSelection == null) {
+            newSelection = Collections.<OsmPrimitive>emptyList();
         }
 
@@ -875,5 +877,5 @@
             }
 
-            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
+            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
             Main.main.undoRedo.add(new ChangePropertyCommand(sel, tags));
 
@@ -905,6 +907,5 @@
 
             Relation rel = new Relation(cur);
-            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
-            for (OsmPrimitive primitive: sel) {
+            for (OsmPrimitive primitive: Main.main.getInProgressSelection()) {
                 rel.removeMembersFor(primitive);
             }
@@ -1108,5 +1109,5 @@
                 return;
             String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
-            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
+            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
             String clipboard = Utils.getClipboardContent();
             if (sel.isEmpty() || clipboard == null)
@@ -1124,5 +1125,5 @@
             int[] rows = tagTable.getSelectedRows();
             Set<String> values = new TreeSet<String>();
-            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
+            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
             if (rows.length == 0 || sel.isEmpty()) return;
 
@@ -1208,5 +1209,5 @@
                 return;
             String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
-            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
+            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
             if (sel.isEmpty())
                 return;
@@ -1243,5 +1244,5 @@
         if ("display.discardable-keys".equals(e.getKey()) && Main.main.getCurrentDataSet() != null) {
             // Re-load data when display preference change
-            selectionChanged(Main.main.getCurrentDataSet().getSelected());
+            updateSelection();
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 6544)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 6546)
@@ -57,9 +57,7 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.actions.mapmode.DrawAction;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Tag;
@@ -105,5 +103,5 @@
     public static final int MAX_LRU_TAGS_NUMBER = 30;
 
-    // LRU cache for recently added tags (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html) 
+    // LRU cache for recently added tags (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html)
     private final Map<Tag, Void> recentTags = new LinkedHashMap<Tag, Void>(MAX_LRU_TAGS_NUMBER+1, 1.1f, true) {
         @Override
@@ -124,21 +122,15 @@
     public void addTag() {
         changedKey = null;
-        if (Main.map.mapMode instanceof DrawAction) {
-            sel = ((DrawAction) Main.map.mapMode).getInProgressSelection();
-        } else {
-            DataSet ds = Main.main.getCurrentDataSet();
-            if (ds == null) return;
-            sel = ds.getSelected();
-        }
-        if (sel.isEmpty()) return;
-
-        final AddTagsDialog addDialog = new AddTagsDialog();        
+        sel = Main.main.getInProgressSelection();
+        if (sel == null || sel.isEmpty()) return;
+
+        final AddTagsDialog addDialog = new AddTagsDialog();
         
         addDialog.showDialog();
         
         addDialog.destroyActions();
-        if (addDialog.getValue() == 1)           
+        if (addDialog.getValue() == 1)
             addDialog.performTagAdding();
-        else 
+        else
             addDialog.undoAllTagsAdding();
     }
@@ -152,6 +144,6 @@
     public void editTag(final int row, boolean focusOnKey) {
         changedKey = null;
-        sel = Main.main.getCurrentDataSet().getSelected();
-        if (sel.isEmpty()) return;
+        sel = Main.main.getInProgressSelection();
+        if (sel == null || sel.isEmpty()) return;
 
         String key = tagData.getValueAt(row, 0).toString();
@@ -159,5 +151,5 @@
         
         @SuppressWarnings("unchecked")
-        final EditTagDialog editDialog = new EditTagDialog(key, row, 
+        final EditTagDialog editDialog = new EditTagDialog(key, row,
                 (Map<String, Integer>) tagData.getValueAt(row, 1), focusOnKey);
         editDialog.showDialog();
@@ -290,5 +282,5 @@
             keys.setSelectedItem(key);
 
-            p.add(Box.createVerticalStrut(5),GBC.eol()); 
+            p.add(Box.createVerticalStrut(5),GBC.eol());
             p.add(new JLabel(tr("Key")), GBC.std());
             p.add(Box.createHorizontalStrut(10), GBC.std());
@@ -307,5 +299,5 @@
             values.setSelectedItem(selection);
             values.getEditor().setItem(selection);
-            p.add(Box.createVerticalStrut(5),GBC.eol()); 
+            p.add(Box.createVerticalStrut(5),GBC.eol());
             p.add(new JLabel(tr("Value")), GBC.std());
             p.add(Box.createHorizontalStrut(10), GBC.std());
@@ -629,5 +621,5 @@
         
         private void suggestRecentlyAddedTags(JPanel mainPanel, int tagsToShow, final FocusAdapter focus) {
-            if (!(tagsToShow > 0 && !recentTags.isEmpty())) 
+            if (!(tagsToShow > 0 && !recentTags.isEmpty()))
                 return;
 
@@ -649,5 +641,5 @@
                     public void actionPerformed(ActionEvent e) {
                         keys.setSelectedItem(t.getKey());
-                        // Update list of values (fix #7951) 
+                        // Update list of values (fix #7951)
                         // fix #8298 - update list of values before setting value (?)
                         focus.focusGained(null);
@@ -691,5 +683,5 @@
                 final String color = action.isEnabled() ? "" : "; color:gray";
                 final JLabel tagLabel = new JLabel("<html>"
-                    + "<style>td{border:1px solid gray; font-weight:normal"+color+"}</style>" 
+                    + "<style>td{border:1px solid gray; font-weight:normal"+color+"}</style>"
                     + "<table><tr><td>" + XmlWriter.encode(t.toString(), true) + "</td></tr></table></html>");
                 if (action.isEnabled()) {
