Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5772)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 5773)
@@ -545,4 +545,5 @@
         presets.setSize(scrollPane.getSize());
 
+        editHelper.loadTagsIfNeeded();
         // -- help action
         //
@@ -731,4 +732,7 @@
     @Override
     public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
+        if (newLayer == null) editHelper.saveTagsIfNeeded();
+        // it is time to save history of tags
+            
         updateSelection();
     }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 5772)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 5773)
@@ -191,4 +191,35 @@
     }
 
+    /**
+     * Load recently used tags from preferences if needed
+     */
+    public void loadTagsIfNeeded() {
+        if (PROPERTY_REMEMBER_TAGS.get() && recentTags.isEmpty()) {
+            recentTags.clear();
+            Collection<String> c = Main.pref.getCollection("properties.recent-tags");
+            Iterator<String> it = c.iterator();
+            String key, value;
+            while (it.hasNext()) {
+                key = it.next();
+                value = it.next();
+                recentTags.put(new Tag(key, value), null);
+            }
+        }
+    }
+
+    /**
+     * Store recently used tags in preferences if needed
+     */
+    public void saveTagsIfNeeded() {
+        if (PROPERTY_REMEMBER_TAGS.get() && !recentTags.isEmpty()) {
+            List<String> c = new ArrayList<String>( recentTags.size()*2 );
+            for (Tag t: recentTags.keySet()) {
+                c.add(t.getKey());
+                c.add(t.getValue());
+            }
+            Main.pref.putCollection("properties.recent-tags", c);
+        }
+    }
+
     public class EditTagDialog extends AbstractTagsDialog {
         final String key;
@@ -376,4 +407,5 @@
 
     public static final BooleanProperty PROPERTY_FIX_TAG_LOCALE = new BooleanProperty("properties.fix-tag-combobox-locale", false);
+    public static final BooleanProperty PROPERTY_REMEMBER_TAGS = new BooleanProperty("properties.remember-recently-added-tags", false);
     public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER = new IntegerProperty("properties.recently-added-tags", DEFAULT_LRU_TAGS_NUMBER);
 
@@ -589,4 +621,14 @@
                 }
             });
+            JCheckBoxMenuItem rememberLastTags = new JCheckBoxMenuItem(
+                new AbstractAction(tr("Remember last used tags")){
+                public void actionPerformed(ActionEvent e) {
+                    boolean sel=((JCheckBoxMenuItem) e.getSource()).getState();
+                    PROPERTY_REMEMBER_TAGS.put(sel);
+                    if (sel) saveTagsIfNeeded();
+                }
+            });
+            rememberLastTags.setState(PROPERTY_REMEMBER_TAGS.get());
+            popupMenu.add(rememberLastTags);
         }
         
