mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 206829: Can't create a newline in some cpp files
This commit is contained in:
parent
57d7ac7888
commit
f9aaf04e88
1 changed files with 4 additions and 8 deletions
|
@ -664,15 +664,9 @@ public final class CIndenter {
|
||||||
if (CCorePlugin.SPACE.equals(fPrefs.prefTabChar)) {
|
if (CCorePlugin.SPACE.equals(fPrefs.prefTabChar)) {
|
||||||
tabs= 0;
|
tabs= 0;
|
||||||
spaces= missing;
|
spaces= missing;
|
||||||
} else if (CCorePlugin.TAB.equals(fPrefs.prefTabChar)) {
|
|
||||||
tabs= tabSize > 0 ? missing / tabSize : 0;
|
|
||||||
spaces= tabSize > 0 ? missing % tabSize : missing;
|
|
||||||
} else if (DefaultCodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) {
|
|
||||||
tabs= tabSize > 0 ? missing / tabSize : 0;
|
|
||||||
spaces= tabSize > 0 ? missing % tabSize : missing;
|
|
||||||
} else {
|
} else {
|
||||||
Assert.isTrue(false);
|
tabs= tabSize > 0 ? missing / tabSize : 0;
|
||||||
return null;
|
spaces= tabSize > 0 ? missing % tabSize : missing;
|
||||||
}
|
}
|
||||||
for (int i= 0; i < tabs; i++)
|
for (int i= 0; i < tabs; i++)
|
||||||
buffer.append('\t');
|
buffer.append('\t');
|
||||||
|
@ -1408,6 +1402,7 @@ public final class CIndenter {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// programming error
|
||||||
Assert.isTrue(false);
|
Assert.isTrue(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1538,6 +1533,7 @@ public final class CIndenter {
|
||||||
return pos; // restore
|
return pos; // restore
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// programming error
|
||||||
Assert.isTrue(false);
|
Assert.isTrue(false);
|
||||||
return -1; // dummy
|
return -1; // dummy
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue