mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-12360 Do not add extra blank line at the end of empty file
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ public class PyTrailingBlankLinesPostFormatProcessor implements PostFormatProces
|
||||
}
|
||||
documentManager.doPostponedOperationsAndUnblockDocument(document);
|
||||
final String text = StringUtil.repeat("\n", numLineFeeds);
|
||||
if (numLineFeeds > 0) {
|
||||
if (numLineFeeds > 0 && whitespaceRange.getStartOffset() != 0) {
|
||||
if (!whitespaceRange.isEmpty()) {
|
||||
document.replaceString(whitespaceRange.getStartOffset(), whitespaceRange.getEndOffset(), text);
|
||||
}
|
||||
|
||||
@@ -562,6 +562,11 @@ public class PyFormatterTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-11552
|
||||
public void testTrailingBlankLinesInEmptyFile() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-15530
|
||||
public void testAlignmentInArgumentListWhereFirstArgumentIsEmptyCall() {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user