PY-14358 Explicitly insert indent before the closing custom folding comment

that is the same as for the opening comment. Otherwise, it's impossible
to detect the necessary indentation in languages like Python, where the
block containing a comment is itself determined by this very indentation.

If it's wrong for some reason, the subsequent call of
CodeStyleManager.adjustLineIndent() should handle that in all other
languages.
This commit is contained in:
Mikhail Golubev
2017-09-21 21:42:59 +03:00
parent 62187abf6e
commit baa7943629
3 changed files with 3 additions and 3 deletions

View File

@@ -306,7 +306,7 @@ public class CustomFoldingSurroundDescriptor implements SurroundDescriptor {
}
String startString = linePrefix + startText + lineSuffix + "\n" + startIndent;
String endString = "\n" + linePrefix + myProvider.getEndString() + lineSuffix;
String endString = "\n" + startIndent + linePrefix + myProvider.getEndString() + lineSuffix;
document.insertString(endOffset, endString);
delta += endString.length();
document.insertString(startOffset, startString);

View File

@@ -14,4 +14,4 @@ class ThisIsATest():
# <editor-fold desc="Description">
def another_four(self):
print "Hello, world!"
# </editor-fold>
# </editor-fold>

View File

@@ -8,4 +8,4 @@ class C:
def m3(self):
pass
# </editor-fold>
# </editor-fold>