Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-05-25 10:22:24 +0000
committerAlexander Kurtakov2017-05-25 10:25:25 +0000
commit0fb4f7743645692ead1221a5f8f8853d13d745f9 (patch)
tree89eab28b588f625caa60b479aeb56d5edb6e6135
parentcad72c665066fb81457d7cee9ebea570c6d8790e (diff)
downloadorg.eclipse.dltk.sh-0fb4f7743645692ead1221a5f8f8853d13d745f9.tar.gz
org.eclipse.dltk.sh-0fb4f7743645692ead1221a5f8f8853d13d745f9.tar.xz
org.eclipse.dltk.sh-0fb4f7743645692ead1221a5f8f8853d13d745f9.zip
Bug 511664 - Copy/paste of entire line indents the next line
As editor auto indents lines trim the text on paste to keep consistent formatting Change-Id: I40fbc25ab7091858a4c4f1040f115db3aac7bee0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/text/ScriptAutoIndentStrategy.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/text/ScriptAutoIndentStrategy.java b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/text/ScriptAutoIndentStrategy.java
index e6815fd..19d73b7 100644
--- a/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/text/ScriptAutoIndentStrategy.java
+++ b/plugins/org.eclipse.dltk.sh.ui/src/org/eclipse/dltk/sh/internal/ui/text/ScriptAutoIndentStrategy.java
@@ -58,6 +58,10 @@ public class ScriptAutoIndentStrategy implements IAutoEditStrategy {
smartIndentAfterNewLine(d, c);
} else if ((c.text.length() == 1) && !c.text.equals("#")) {
smartIndentAfterKeypress(d, c);
+ } else if (c.text.length() > 1) {
+ // as editor auto indents lines trim the text on paste to keep consistent
+ // formatting
+ c.text = c.text.trim();
}
}

Back to the top