Setting for space before # (PY-8273).

This commit is contained in:
Dmitry Trofimov
2014-02-03 12:56:09 +04:00
parent 6aaf437b67
commit b9e64940ba
3 changed files with 3 additions and 1 deletions
@@ -516,7 +516,7 @@ public class PyBlock implements ASTBlock {
}
}
if (psi2 instanceof PsiComment && !hasLineBreaksBefore(psi2.getNode(), 1)) {
if (psi2 instanceof PsiComment && !hasLineBreaksBefore(psi2.getNode(), 1) && myContext.getPySettings().SPACE_BEFORE_NUMBER_SIGN) {
return Spacing.createSpacing(2, 0, 0, false, 0);
}
}
@@ -39,6 +39,7 @@ public class PyCodeStyleSettings extends CustomCodeStyleSettings {
public boolean NEW_LINE_AFTER_COLON_MULTI_CLAUSE = true;
public boolean SPACE_AFTER_NUMBER_SIGN = true;
public boolean SPACE_BEFORE_NUMBER_SIGN = true;
public PyCodeStyleSettings(CodeStyleSettings container) {
super("Python", container);
@@ -76,6 +76,7 @@ public class PyLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettin
ApplicationBundle.message("checkbox.spaces.before.colon"), SPACES_OTHER);
consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AFTER_PY_COLON", ApplicationBundle.message("checkbox.spaces.after.colon"), SPACES_OTHER);
consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_BACKSLASH", "Before '\\'", SPACES_OTHER);
consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_NUMBER_SIGN", "Before '#'", SPACES_OTHER);
consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AFTER_NUMBER_SIGN", "After '#'", SPACES_OTHER);
}
else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) {