commit | ca8ea173ecd992f9e98376f4b6f66c9606e3909d | [log] [tgz] |
---|---|---|
author | jcompagne <jcompagne> | Wed Jun 24 08:58:45 2009 +0000 |
committer | jcompagne <jcompagne> | Wed Jun 24 08:58:45 2009 +0000 |
tree | 080e6bd1ddcfbdca544fb8163d7a574d4c12a77d | |
parent | 4237396cdd8abec24003c7ffc3093b857e1fb240 [diff] |
better support for paste (1 line/text)
diff --git a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java index 02ce720..8cc69f2 100644 --- a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java +++ b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java
@@ -564,9 +564,10 @@ clipboard.dispose(); if (text != null && text.length() > 0) { if (text.indexOf("\n") == -1) { - int cp = getCaretPosition(); - insertText(text); - setCaretOffset(cp + text.length()); + Point selectedRange = getSelectedRange(); + getTextWidget().insert(text); + setCaretOffset(selectedRange.x + + text.length()); } else { StringTokenizer tokenizer = new StringTokenizer(