mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
Fix index guard in getPreviousHiddenPart()
Fixes an index guard that prevents org.eclipse.xtext.formatting2.regionaccess.internal.NodeHidden#getPreviousHiddenPart() from returning the first part of a hidden region. Old behavior: Given a hidden region consisting of two or more parts When getPreviousHiddenPart() is called on the second part Then null is returned New behaviour: Given a hidden region consisting of two or more parts When getPreviousHiddenPart() is called on the second part Then first part ist returned Signed-off-by: Moritz Heindl <lenidh@gmail.com>
This commit is contained in:
parent
59a500b0bf
commit
4db8d0941b
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ public class NodeHidden extends NodeRegion implements IHiddenRegionPart {
|
|||
public IHiddenRegionPart getPreviousHiddenPart() {
|
||||
List<IHiddenRegionPart> parts = hiddenRegion.getParts();
|
||||
int i = parts.indexOf(this) - 1;
|
||||
if (i > 0)
|
||||
if (i >= 0)
|
||||
return parts.get(i);
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue