IDEA-276588 InlayModel interface doesn't expose hasAfterLineEndElements

GitOrigin-RevId: be5255451b711b5710af89ad6777964bc9ac9161
This commit is contained in:
Dmitry Batrak
2021-08-23 13:08:07 +00:00
committed by intellij-monorepo-bot
parent 42a5c68689
commit d53d3825df
2 changed files with 8 additions and 0 deletions
@@ -238,6 +238,13 @@ public interface InlayModel {
@NotNull
List<Inlay<?>> getAfterLineEndElementsForLogicalLine(int logicalLine);
/**
* Tells whether there exists at least one after-line-end element currently.
*/
default boolean hasAfterLineEndElements() {
return !getAfterLineEndElementsInRange(0, Integer.MAX_VALUE).isEmpty();
}
/**
* When text is inserted at inline element's offset, resulting element's position is determined by its
* {@link InlayProperties#relatesToPrecedingText(boolean)} property. But to enable natural editing experience around inline elements
@@ -493,6 +493,7 @@ public final class InlayModelImpl implements InlayModel, PrioritizedDocumentList
return (List)result;
}
@Override
public boolean hasAfterLineEndElements() {
return myAfterLineEndElementsTree.size() > 0;
}