mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Additional fix and test for bug 322776
This commit is contained in:
parent
8ccaca146c
commit
f9b519b6dd
2 changed files with 5 additions and 5 deletions
|
@ -462,7 +462,7 @@ public class Scribe {
|
|||
private String getPreserveEmptyLines(int count) {
|
||||
if (count == 0 && !preserveNewLines) {
|
||||
// preserve line breaks in wrapping if specified
|
||||
if ((!preferences.join_wrapped_lines) && lastNumberOfNewLines == 0) {
|
||||
if (!preferences.join_wrapped_lines && lastNumberOfNewLines == 0) {
|
||||
// Create new line
|
||||
StringBuilder tempBuffer = new StringBuilder();
|
||||
tempBuffer.append(getNewLine());
|
||||
|
@ -770,7 +770,9 @@ public class Scribe {
|
|||
handleLineTooLong();
|
||||
}
|
||||
lastNumberOfNewLines= 0;
|
||||
printIndentationIfNecessary();
|
||||
if (indentationLevel != 0) {
|
||||
printIndentationIfNecessary();
|
||||
}
|
||||
if (considerSpaceIfAny) {
|
||||
space();
|
||||
}
|
||||
|
@ -1150,7 +1152,6 @@ public class Scribe {
|
|||
if (indentationsAsTab < numberOfLeadingIndents) {
|
||||
buffer.append('\t');
|
||||
indentationsAsTab++;
|
||||
lastNumberOfNewLines= 0;
|
||||
int complement= tabLength - ((column - 1) % tabLength); // amount
|
||||
// of
|
||||
// space
|
||||
|
@ -1165,7 +1166,6 @@ public class Scribe {
|
|||
} else {
|
||||
while (column <= indentationLevel) {
|
||||
buffer.append('\t');
|
||||
lastNumberOfNewLines= 0;
|
||||
int complement= tabLength - ((column - 1) % tabLength); // amount
|
||||
// of
|
||||
// space
|
||||
|
|
|
@ -1458,7 +1458,7 @@ public class CodeFormatterTest extends BaseUITestCase {
|
|||
//#define X() { }
|
||||
//void g() {
|
||||
// X();
|
||||
// if (1) {
|
||||
// if (1) {
|
||||
// x();
|
||||
// }
|
||||
// z();
|
||||
|
|
Loading…
Add table
Reference in a new issue