mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Setting for space before # (PY-8273).
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user