8000 fix in getLeadingWhitespace(): if comment just go to the partition start · CoderGears/dltk.javascript@6d3016f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d3016f

Browse files
author
apanchenk
committed
fix in getLeadingWhitespace(): if comment just go to the partition start
1 parent 3a86ed5 commit 6d3016f

File tree

1 file changed

+4
-12
lines changed
  • plugins/org.eclipse.dltk.javascript.ui/src/org/eclipse/dltk/javascript/scriptdoc

1 file changed

+4
-12
lines changed

plugins/org.eclipse.dltk.javascript.ui/src/org/eclipse/dltk/javascript/scriptdoc/JavaIndenter.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -646,20 +646,12 @@ private StringBuffer getLeadingWhitespace(int offset) {
646646
ITypedRegion partition = TextUtilities.getPartition(fDocument,
647647
IJavaScriptPartitions.JS_PARTITIONING, lineOffset, true);
648648
String type = partition.getType();
649-
while ((type.equals(IJavaScriptPartitions.JS_DOC) || type
649+
if ((type.equals(IJavaScriptPartitions.JS_DOC) || type
650650
.equals(IJavaScriptPartitions.JS_MULTI_LINE_COMMENT))
651651
&& lineOffset > 0) {
652-
IRegion tmpLine = fDocument
653-
.getLineInformationOfOffset(lineOffset - 1);
654-
partition = TextUtilities.getPartition(fDocument,
655-
IJavaScriptPartitions.JS_PARTITIONING,
656-
tmpLine.getOffset(), false);
657-
type = partition.getType();
658-
if (type.equals(IJavaScriptPartitions.JS_DOC)
659-
|| type.equals(IJavaScriptPartitions.JS_MULTI_LINE_COMMENT)) {
660-
line = tmpLine;
661-
lineOffset = line.getOffset();
662-
}
652+
line = fDocument.getLineInformationOfOffset(partition
653+
.getOffset());
654+
lineOffset = line.getOffset();
663655
}
664656
int nonWS = fScanner.findNonWhitespaceForwardInAnyPartition(
665657
lineOffset, lineOffset + line.getLength());

0 commit comments

Comments
 (0)
0