mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
e07fbf49f5
commit
e5c42af4c9
2 changed files with 79 additions and 80 deletions
|
@ -36,7 +36,6 @@ import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.text.edits.TextEdit;
|
import org.eclipse.text.edits.TextEdit;
|
||||||
|
|
||||||
public class CCodeFormatter extends CodeFormatter {
|
public class CCodeFormatter extends CodeFormatter {
|
||||||
|
|
||||||
private DefaultCodeFormatterOptions preferences;
|
private DefaultCodeFormatterOptions preferences;
|
||||||
private Map<String, ?> options;
|
private Map<String, ?> options;
|
||||||
|
|
||||||
|
@ -78,8 +77,7 @@ public class CCodeFormatter extends CodeFormatter {
|
||||||
|
|
||||||
case DefaultCodeFormatterOptions.MIXED:
|
case DefaultCodeFormatterOptions.MIXED:
|
||||||
int tabSize= preferences.tab_size;
|
int tabSize= preferences.tab_size;
|
||||||
int spaceEquivalents= indentationLevel
|
int spaceEquivalents= indentationLevel * preferences.indentation_size;
|
||||||
* preferences.indentation_size;
|
|
||||||
tabs= spaceEquivalents / tabSize;
|
tabs= spaceEquivalents / tabSize;
|
||||||
spaces= spaceEquivalents % tabSize;
|
spaces= spaceEquivalents % tabSize;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3419,6 +3419,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
||||||
private int peekNextToken() {
|
private int peekNextToken() {
|
||||||
return peekNextToken(false);
|
return peekNextToken(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int peekNextToken(boolean ignoreSkip) {
|
private int peekNextToken(boolean ignoreSkip) {
|
||||||
if (!ignoreSkip && scribe.shouldSkip(scribe.scanner.getCurrentPosition())) {
|
if (!ignoreSkip && scribe.shouldSkip(scribe.scanner.getCurrentPosition())) {
|
||||||
return Token.tBADCHAR;
|
return Token.tBADCHAR;
|
||||||
|
|
Loading…
Add table
Reference in a new issue