mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
if comma is followed by whitespace, wrap after whitespace rather than before it
This commit is contained in:
+8
-2
@@ -78,8 +78,14 @@ public class GenericLineWrapPositionStrategy implements LineWrapPositionStrategy
|
||||
Rule rule = myRules.get(c);
|
||||
if (rule != null) {
|
||||
if (rule.condition == WrapCondition.BOTH || rule.condition == WrapCondition.AFTER) {
|
||||
if (i < maxPreferredOffsetToUse) {
|
||||
offset2Weight.put(i + 1, rule.weight);
|
||||
int target = i+1;
|
||||
if (rule.symbol != ' ') {
|
||||
while(i < maxPreferredOffsetToUse && text.charAt(target) == ' ') {
|
||||
target++;
|
||||
}
|
||||
}
|
||||
if (target <= maxPreferredOffsetToUse) {
|
||||
offset2Weight.put(target, rule.weight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class DefaultLineWrapPositionStrategyTest {
|
||||
@Test
|
||||
public void preferWrapOnComma() {
|
||||
String document =
|
||||
"int variable = testMethod(var1 + var2,<WRAP> var3 + va<EDGE>r4);";
|
||||
"int variable = testMethod(var1 + var2, <WRAP>var3 + va<EDGE>r4);";
|
||||
doTest(document);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user