Search in sources :

Example 1 with IndentGuideDescriptor

use of com.intellij.openapi.editor.IndentGuideDescriptor in project intellij-community by JetBrains.

the class IndentsModelImpl method assumeIndents.

@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);
    }
}
Also used : IndentGuideDescriptor(com.intellij.openapi.editor.IndentGuideDescriptor)

Example 2 with IndentGuideDescriptor

use of com.intellij.openapi.editor.IndentGuideDescriptor in project intellij-community by JetBrains.

the class IndentsModelImpl method getCaretIndentGuide.

@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;
}
Also used : LogicalPosition(com.intellij.openapi.editor.LogicalPosition) IndentGuideDescriptor(com.intellij.openapi.editor.IndentGuideDescriptor)

Aggregations

IndentGuideDescriptor (com.intellij.openapi.editor.IndentGuideDescriptor)2 LogicalPosition (com.intellij.openapi.editor.LogicalPosition)1