Search in sources :

Example 1 with HighlightManagerImpl

use of com.intellij.codeInsight.highlighting.HighlightManagerImpl in project intellij-community by JetBrains.

the class FindManagerImpl method findNextUsageInFile.

private boolean findNextUsageInFile(@NotNull FileEditor fileEditor, @NotNull SearchResults.Direction direction) {
    if (fileEditor instanceof TextEditor) {
        TextEditor textEditor = (TextEditor) fileEditor;
        Editor editor = textEditor.getEditor();
        editor.getCaretModel().removeSecondaryCarets();
        if (tryToFindNextUsageViaEditorSearchComponent(editor, direction)) {
            return true;
        }
        RangeHighlighter[] highlighters = ((HighlightManagerImpl) HighlightManager.getInstance(myProject)).getHighlighters(editor);
        if (highlighters.length > 0) {
            return highlightNextHighlighter(highlighters, editor, editor.getCaretModel().getOffset(), direction == SearchResults.Direction.DOWN, false);
        }
    }
    if (direction == SearchResults.Direction.DOWN) {
        return myFindUsagesManager.findNextUsageInFile(fileEditor);
    }
    return myFindUsagesManager.findPreviousUsageInFile(fileEditor);
}
Also used : RangeHighlighter(com.intellij.openapi.editor.markup.RangeHighlighter) TextEditor(com.intellij.openapi.fileEditor.TextEditor) TextEditor(com.intellij.openapi.fileEditor.TextEditor) FileEditor(com.intellij.openapi.fileEditor.FileEditor) HighlightManagerImpl(com.intellij.codeInsight.highlighting.HighlightManagerImpl)

Aggregations

HighlightManagerImpl (com.intellij.codeInsight.highlighting.HighlightManagerImpl)1 RangeHighlighter (com.intellij.openapi.editor.markup.RangeHighlighter)1 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 TextEditor (com.intellij.openapi.fileEditor.TextEditor)1