mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Removed a strange logic which breaks alignment if there is an extra line break between blocks to be aligned.
This commit is contained in:
@@ -107,33 +107,19 @@ class AlignmentImpl extends Alignment {
|
||||
}
|
||||
LeafBlockWrapper result = null;
|
||||
if (myOffsetRespBlocks != EMPTY) {
|
||||
LeafBlockWrapper firstBlockAfterLineFeed = null;
|
||||
LeafBlockWrapper firstAlignedBlock = null;
|
||||
LeafBlockWrapper lastAlignedBlock = null;
|
||||
for (final LeafBlockWrapper current : myOffsetRespBlocks) {
|
||||
if (block == null || current.getStartOffset() < block.getStartOffset()) {
|
||||
if (!onDifferentLines(current, block)) {
|
||||
continue;
|
||||
}
|
||||
if (firstAlignedBlock == null || firstAlignedBlock.getStartOffset() > current.getStartOffset()) {
|
||||
firstAlignedBlock = current;
|
||||
}
|
||||
|
||||
if (lastAlignedBlock == null || lastAlignedBlock.getStartOffset() < current.getStartOffset()) {
|
||||
lastAlignedBlock = current;
|
||||
}
|
||||
|
||||
if (firstBlockAfterLineFeed == null && current.getWhiteSpace().containsLineFeeds()) {
|
||||
firstBlockAfterLineFeed = current;
|
||||
}
|
||||
|
||||
}
|
||||
//each.remove();
|
||||
}
|
||||
if (firstBlockAfterLineFeed != null) {
|
||||
result = firstBlockAfterLineFeed;
|
||||
}
|
||||
else if (firstAlignedBlock != null) {
|
||||
if (firstAlignedBlock != null) {
|
||||
result = firstAlignedBlock;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -12,5 +12,5 @@ xsi:schemaLocation=
|
||||
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
|
||||
http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
|
||||
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
|
||||
<caret>xmlns:async="http://jboss.com/products/seam/async"
|
||||
<caret>xmlns:async="http://jboss.com/products/seam/async"
|
||||
/>
|
||||
@@ -4,8 +4,8 @@ xmlns:persistence="http://jboss.com/products/seam/persistence"
|
||||
xmlns:framework="http://jboss.com/products/seam/framework"
|
||||
xmlns:web="http://jboss.com/products/seam/web"
|
||||
xmlns:security="http://jboss.com/products/seam/security"
|
||||
<caret>xmlns:async="http://jboss.com/products/seam/async"
|
||||
xmlns:xsi
|
||||
<caret>xmlns:async="http://jboss.com/products/seam/async"
|
||||
xmlns:xsi
|
||||
="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation=
|
||||
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
|
||||
|
||||
@@ -6,8 +6,8 @@ xmlns:web="http://jboss.com/products/seam/web"
|
||||
xmlns:security="http://jboss.com/products/seam/security"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:async="http://jboss.com/products/seam/async"
|
||||
<caret>xsi:schemaLocation=
|
||||
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
|
||||
<caret>xsi:schemaLocation=
|
||||
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
|
||||
http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
|
||||
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
|
||||
http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
|
||||
|
||||
@@ -4,12 +4,12 @@ xmlns:persistence="http://jboss.com/products/seam/persistence"
|
||||
xmlns:framework="http://jboss.com/products/seam/framework"
|
||||
xmlns:web="http://jboss.com/products/seam/web"
|
||||
xmlns:security="http://jboss.com/products/seam/security"
|
||||
<caret>xsi:schemaLocation=
|
||||
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
|
||||
<caret>xsi:schemaLocation=
|
||||
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
|
||||
http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
|
||||
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
|
||||
http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd
|
||||
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:async="http://jboss.com/products/seam/async"
|
||||
/>
|
||||
Reference in New Issue
Block a user