mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-59034 Editor: Modify default wrap strategy in order to prefer wrap on comma if possible
Fixing tests
This commit is contained in:
+1
-1
@@ -127,7 +127,7 @@ public class GenericLineWrapPositionStrategy implements LineWrapPositionStrategy
|
||||
}
|
||||
}
|
||||
|
||||
return maxPreferredOffsetToUse;
|
||||
return endOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -419,7 +419,7 @@ public class SoftWrapApplianceManager implements FoldingListener, DocumentListen
|
||||
myLineWrapPositionStrategy = LanguageLineWrapPositionStrategy.INSTANCE.forEditor(myEditor);
|
||||
}
|
||||
int softWrapOffset = myLineWrapPositionStrategy.calculateWrapPosition(
|
||||
document.getCharsSequence(), minOffset, maxOffset, preferredOffset, minOffset != preferredOffset
|
||||
document.getCharsSequence(), minOffset, maxOffset, preferredOffset, true
|
||||
);
|
||||
if (softWrapOffset >= lineData.endLineOffset) {
|
||||
return null;
|
||||
@@ -625,7 +625,7 @@ public class SoftWrapApplianceManager implements FoldingListener, DocumentListen
|
||||
int endLine = document.getLineNumber(endRange.getEndOffset());
|
||||
int endOffset = document.getLineEndOffset(endLine);
|
||||
int textLength = document.getTextLength();
|
||||
if (textLength > 0 && endOffset >= textLength) {
|
||||
if (textLength > 0 && endOffset > textLength) {
|
||||
endOffset = textLength - 1;
|
||||
}
|
||||
endRange = new TextRange(document.getLineStartOffset(startLine), endOffset);
|
||||
|
||||
Reference in New Issue
Block a user