mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Reformat with context: do not touch blocks with read only spacing property.
Spacing is set to read-only by FormattingModelBuilder implementors, so they expect spacing to be really read-only, however if WhiteSpace is read-only but Spacing is not, it means that we are formatting text range, and current WhiteSpace is not located inside, so we can modify in such a case
This commit is contained in:
@@ -475,7 +475,7 @@ public class FormatProcessor {
|
||||
final WhiteSpace whiteSpace = myCurrentBlock.getWhiteSpace();
|
||||
|
||||
if (isReformatSelectedRangesContext()) {
|
||||
if (isCurrentBlockAlignmentUsedInRangesToModify() && whiteSpace.isReadOnly()) {
|
||||
if (isCurrentBlockAlignmentUsedInRangesToModify() && whiteSpace.isReadOnly() && !spaceProperty.isReadOnly()) {
|
||||
whiteSpace.setReadOnly(false);
|
||||
whiteSpace.setLineFeedsAreReadOnly(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user