mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
For whitesmiths, make start of line to be indented with block
This commit is contained in:
parent
2ec0660653
commit
de22c3b311
2 changed files with 11 additions and 1 deletions
|
@ -515,6 +515,16 @@ public class CAutoIndentTest extends AbstractAutoEditTest {
|
||||||
assertEquals("}", tester.getLine(1)); //$NON-NLS-1$
|
assertEquals("}", tester.getLine(1)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSkipToStatementStartWhitesmiths_Bug311018() throws Exception {
|
||||||
|
DefaultCodeFormatterOptions whitesmiths= DefaultCodeFormatterOptions.getWhitesmithsSettings();
|
||||||
|
CCorePlugin.setOptions(new HashMap<String, String>(whitesmiths.getMap()));
|
||||||
|
AutoEditTester tester = createAutoEditTester();
|
||||||
|
tester.type("if (i > 0)\n"); //$NON-NLS-1$
|
||||||
|
tester.type("{\n"); //$NON-NLS-1$
|
||||||
|
// start is indented to the brace
|
||||||
|
assertEquals("if (i > 0)\n {\n \n }", tester.fDoc.get());
|
||||||
|
}
|
||||||
|
|
||||||
private void assertNoError() {
|
private void assertNoError() {
|
||||||
if (!fStatusLog.isEmpty()) {
|
if (!fStatusLog.isEmpty()) {
|
||||||
fail(fStatusLog.get(0).toString());
|
fail(fStatusLog.get(0).toString());
|
||||||
|
|
|
@ -1319,8 +1319,8 @@ public final class CIndenter {
|
||||||
case Symbols.TokenWHILE:
|
case Symbols.TokenWHILE:
|
||||||
case Symbols.TokenFOR:
|
case Symbols.TokenFOR:
|
||||||
case Symbols.TokenTRY:
|
case Symbols.TokenTRY:
|
||||||
|
fIndent += fPrefs.prefIndentBracesForBlocks ? 1 : 0;
|
||||||
return fPosition;
|
return fPosition;
|
||||||
|
|
||||||
case Symbols.TokenCLASS:
|
case Symbols.TokenCLASS:
|
||||||
case Symbols.TokenSTRUCT:
|
case Symbols.TokenSTRUCT:
|
||||||
case Symbols.TokenUNION:
|
case Symbols.TokenUNION:
|
||||||
|
|
Loading…
Add table
Reference in a new issue