mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-59312, EA-59313 - avoid exception in FormatterImpl.getLineIndent in case of empty document
This commit is contained in:
@@ -570,6 +570,7 @@ public class FormatterImpl extends FormatterEx
|
||||
final TextRange affectedRange) {
|
||||
final FormattingDocumentModel documentModel = model.getDocumentModel();
|
||||
final Block block = model.getRootBlock();
|
||||
if (block.getTextRange().isEmpty()) return null; // handing empty document case
|
||||
final FormatProcessor processor = buildProcessorAndWrapBlocks(
|
||||
documentModel, block, settings, indentOptions, new FormatTextRanges(affectedRange, true), offset
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user