src/Tools/jEdit/src/completion_popup.scala
changeset 55666 cc350eb1087e
parent 55616 25a7a998852a
child 55690 d73949233c2e
--- a/src/Tools/jEdit/src/completion_popup.scala	Fri Feb 21 23:42:43 2014 +0100
+++ b/src/Tools/jEdit/src/completion_popup.scala	Sat Feb 22 15:07:33 2014 +0100
@@ -87,6 +87,8 @@
             case Some(text) if text == item.original =>
               buffer.remove(caret - len, len)
               buffer.insert(caret - len, item.replacement)
+              if (item.move != 0)
+                text_area.moveCaretPosition(text_area.getCaretPosition + item.move)
             case _ =>
           }
         }
@@ -265,7 +267,7 @@
               content.substring(0, caret - len) +
               item.replacement +
               content.substring(caret))
-            text_field.getCaret.setDot(caret - len + item.replacement.length)
+            text_field.getCaret.setDot(caret - len + item.replacement.length + item.move)
           case _ =>
         }
       }