diff --git a/src/org/openstreetmap/josm/actions/OpenFileAction.java b/src/org/openstreetmap/josm/actions/OpenFileAction.java
index 53957f9..a61bda6 100644
--- a/src/org/openstreetmap/josm/actions/OpenFileAction.java
+++ b/src/org/openstreetmap/josm/actions/OpenFileAction.java
@@ -275,15 +275,7 @@ public class OpenFileAction extends DiskAccessAction {
                     // remove the files which failed to load from the list
                     fileHistory.removeAll(failedAll);
                     int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
-                    Collection<String> trimmedFileHistory = new ArrayList<String>(Math.min(maxsize, fileHistory.size()));
-                    int i = 0;
-                    for (String s : fileHistory) {
-                        if (++i > maxsize) {
-                            break;
-                        }
-                        trimmedFileHistory.add(s);
-                    }
-                    Main.pref.putCollection("file-open.history", trimmedFileHistory);
+                    Main.pref.putCollectionBounded("file-open.history", maxsize, fileHistory);
                 }
             }
         }
diff --git a/src/org/openstreetmap/josm/actions/SaveActionBase.java b/src/org/openstreetmap/josm/actions/SaveActionBase.java
index 99ac086..293c29d 100644
--- a/src/org/openstreetmap/josm/actions/SaveActionBase.java
+++ b/src/org/openstreetmap/josm/actions/SaveActionBase.java
@@ -6,7 +6,9 @@ import static org.openstreetmap.josm.tools.I18n.tr;
 import java.awt.event.ActionEvent;
 import java.io.File;
 import java.io.IOException;
-
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
 import javax.swing.filechooser.FileFilter;
@@ -22,15 +24,21 @@ import org.openstreetmap.josm.io.FileExporter;
 import org.openstreetmap.josm.tools.Shortcut;
 
 public abstract class SaveActionBase extends DiskAccessAction {
+    private File file;
 
     public SaveActionBase(String name, String iconName, String tooltip, Shortcut shortcut) {
         super(name, iconName, tooltip, shortcut);
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
-        if (!isEnabled())
+        if (!isEnabled()) {
             return;
-        doSave();
+        }
+        boolean saved = doSave();
+        if (saved) {
+            addToFileOpenHistory();
+        }
     }
 
     public boolean doSave() {
@@ -47,7 +55,8 @@ public abstract class SaveActionBase extends DiskAccessAction {
     public boolean doSave(Layer layer) {
         if(!checkSaveConditions(layer))
             return false;
-        return doInternalSave(layer, getFile(layer));
+        file = getFile(layer);
+        return doInternalSave(layer, file);
     }
 
     public boolean doSave(Layer layer, File file) {
@@ -223,4 +232,19 @@ public abstract class SaveActionBase extends DiskAccessAction {
         }
         return true;
     }
+
+    protected void addToFileOpenHistory() {
+        String filepath;
+        try {
+            filepath = file.getCanonicalPath();
+        } catch (IOException ign) {
+            return;
+        }
+
+        int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
+        Collection<String> oldHistory = Main.pref.getCollection("file-open.history");
+        List<String> history = new LinkedList<String>(oldHistory);
+        history.add(0, filepath);
+        Main.pref.putCollectionBounded("file-open.history", maxsize, history);
+    }
 }
diff --git a/src/org/openstreetmap/josm/data/Preferences.java b/src/org/openstreetmap/josm/data/Preferences.java
index c8444f5..ea3e992 100644
--- a/src/org/openstreetmap/josm/data/Preferences.java
+++ b/src/org/openstreetmap/josm/data/Preferences.java
@@ -740,6 +740,20 @@ public class Preferences {
         return put(key, Utils.join("\u001e", val));
     }
 
+    /**
+     * Saves at most {@code maxsize} items of collection {@code val}.
+     */
+    public boolean putCollectionBounded(String key, int maxsize, Collection<String> val) {
+        Collection<String> newCollection = new ArrayList<String>(maxsize);
+        for (String i : val) {
+            if (newCollection.size() >= maxsize) {
+                break;
+            }
+            newCollection.add(i);
+        }
+        return putCollection(key, newCollection);
+    }
+
     synchronized private void putCollectionDefault(String key, Collection<String> val) {
         putDefault(key, Utils.join("\u001e", val));
     }
