@Override public IndentGuideDescriptor getCaretIndentGuide() { final LogicalPosition pos = myEditor.getCaretModel().getLogicalPosition(); final int column = pos.column; final int line = pos.line; if (column > 0) { for (IndentGuideDescriptor indent : myIndents) { if (column == indent.indentLevel && line >= indent.startLine && line < indent.endLine) { return indent; } } } return null; }
@Override public void assumeIndents(@NotNull List<IndentGuideDescriptor> descriptors) { myIndents = descriptors; myIndentsByLines.clear(); for (IndentGuideDescriptor descriptor : myIndents) { myIndentsByLines.put(new IntPair(descriptor.startLine, descriptor.endLine), descriptor); } }
@Override public void assumeIndents(@Nonnull List<IndentGuideDescriptor> descriptors) { myIndents = descriptors; myIndentsByLines.clear(); for (IndentGuideDescriptor descriptor : myIndents) { myIndentsByLines.put(new IntPair(descriptor.startLine, descriptor.endLine), descriptor); } }
@Override public IndentGuideDescriptor getCaretIndentGuide() { return null; }
@Override public IndentGuideDescriptor getDescriptor(int startLine, int endLine) { return null; }
@Override public void assumeIndents(List<IndentGuideDescriptor> descriptors) { }
@NotNull public List<IndentGuideDescriptor> getIndents() { return myIndents; }
@Override public IndentGuideDescriptor getDescriptor(int startLine, int endLine) { return myIndentsByLines.get(new IntPair(startLine, endLine)); }
@Nonnull public List<IndentGuideDescriptor> getIndents() { return myIndents; }