mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 01:45:33 +02:00
Formatting bug fixes.
This commit is contained in:
parent
6972073054
commit
5cba3bf285
2 changed files with 9 additions and 0 deletions
|
@ -1606,6 +1606,7 @@ public class Scribe {
|
||||||
case Token.tRBRACE:
|
case Token.tRBRACE:
|
||||||
case Token.tLBRACE:
|
case Token.tLBRACE:
|
||||||
formatBrace = true;
|
formatBrace = true;
|
||||||
|
lastLineComment.contiguous = false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
printComment();
|
printComment();
|
||||||
|
|
|
@ -888,19 +888,27 @@ public class CodeFormatterTest extends BaseUITestCase {
|
||||||
assertFormatterResult();
|
assertFormatterResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//namespace ns1 {
|
||||||
|
//namespace ns2 {
|
||||||
//void foo() {
|
//void foo() {
|
||||||
// int x; // comment
|
// int x; // comment
|
||||||
// int y; // comment
|
// int y; // comment
|
||||||
// // continuation of the previous comment
|
// // continuation of the previous comment
|
||||||
//// int z; <- comments starting from the beginning of line are not indented
|
//// int z; <- comments starting from the beginning of line are not indented
|
||||||
//}
|
//}
|
||||||
|
//}// namespace ns2
|
||||||
|
//}// namespace ns1
|
||||||
|
|
||||||
|
//namespace ns1 {
|
||||||
|
//namespace ns2 {
|
||||||
//void foo() {
|
//void foo() {
|
||||||
// int x; // comment
|
// int x; // comment
|
||||||
// int y; // comment
|
// int y; // comment
|
||||||
// // continuation of the previous comment
|
// // continuation of the previous comment
|
||||||
//// int z; <- comments starting from the beginning of line are not indented
|
//// int z; <- comments starting from the beginning of line are not indented
|
||||||
//}
|
//}
|
||||||
|
//} // namespace ns2
|
||||||
|
//} // namespace ns1
|
||||||
public void testLineCommentMinDistanceFromCode() throws Exception {
|
public void testLineCommentMinDistanceFromCode() throws Exception {
|
||||||
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
|
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
|
||||||
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
|
fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
|
||||||
|
|
Loading…
Add table
Reference in a new issue