提交 637bf87e 编写于 作者: S serge-rider

#3326 SQL auto-indent fix.


Former-commit-id: 4454d843
上级 cef38423
......@@ -137,13 +137,16 @@ public class SQLIndenter {
try {
IRegion line = document.getLineInformationOfOffset(offset);
int lineOffset = line.getOffset();
if (scanner.endsWithDelimiter(lineOffset, lineOffset + line.getLength())) {
return "";
}
int nonWS = scanner.findNonWhitespaceForwardInAnyPartition(lineOffset, lineOffset + line.getLength());
if (nonWS < 0) {
return "";
}
int indentLength = nonWS - lineOffset;
StringBuilder indent = createIndent();
if (indentLength > indent.length() && scanner.endsWithDelimiter(lineOffset, lineOffset + line.getLength())) {
nonWS -= indent.length();
}
return document.get(lineOffset, nonWS - lineOffset);
}
catch (BadLocationException e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册