Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/TagFieldEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/TagFieldEditor.java	(revision 1770)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/TagFieldEditor.java	(revision 1771)
@@ -40,4 +40,14 @@
                 return;
             }
+
+            // if the current offset isn't at the end of the document we don't autocomplete.
+            // If a highlighted autocompleted suffix was present and we get here Swing has
+            // already removed it from the document. getLength() therefore doesn't include the
+            // autocompleted suffix.
+            //
+            if (offs < getLength()) {
+                super.insertString(offs, str, a);
+                return;
+            }
             String currentText = getText(0, getLength());
             String prefix = currentText.substring(0, offs);
@@ -62,4 +72,5 @@
                 super.insertString(0,newText,a);
                 setCaretPosition(getLength());
+
             }
         }
