Bug 493958 - ShellEd incorrectly auto-prepends&indents "#" character at
start of lines
Do not auto-indent for # key.
Change-Id: I9f1b4cb9afb79e69f4c4c79dc32cabbb077603d6
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
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 8398b3f..b41a691 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat Inc. and others.
+ * Copyright (c) 2009, 2016 Red Hat Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,7 +56,7 @@
int delim = TextUtilities.endsWith(d.getLegalLineDelimiters(), c.text);
if ((c.length == 0) && (c.text != null) && (delim != -1)) {
smartIndentAfterNewLine(d, c);
- } else if (c.text.length() == 1) {
+ } else if ((c.text.length() == 1) && !c.text.equals("#")) {
smartIndentAfterKeypress(d, c);
}
}