mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2025-05-08 12:34:06 +02:00
parent
48c8cc73b0
commit
93f5911faf
src/main/kotlin/com/chylex/intellij/coloredbrackets/indents
@ -8,7 +8,6 @@ import com.intellij.ide.actions.ToggleZenModeAction
|
||||
import com.intellij.lang.LanguageParserDefinitions
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.IndentGuideDescriptor
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil
|
||||
import com.intellij.openapi.editor.markup.HighlighterTargetArea
|
||||
import com.intellij.openapi.editor.markup.MarkupModel
|
||||
@ -35,11 +34,9 @@ import java.util.Collections
|
||||
* */
|
||||
class RainbowIndentsPass internal constructor(
|
||||
project: Project,
|
||||
editor: Editor,
|
||||
private val myEditor: Editor,
|
||||
private val myFile: PsiFile,
|
||||
) : TextEditorHighlightingPass(project, editor.document, false), DumbAware {
|
||||
|
||||
private val myEditor: EditorEx = editor as EditorEx
|
||||
) : TextEditorHighlightingPass(project, myEditor.document, false), DumbAware {
|
||||
|
||||
@Volatile
|
||||
private var myRanges = emptyList<TextRange>()
|
||||
|
@ -1,19 +1,22 @@
|
||||
package com.chylex.intellij.coloredbrackets.indents
|
||||
|
||||
import com.intellij.codeHighlighting.Pass
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactoryRegistrar
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.impl.ImaginaryEditor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
|
||||
class RainbowIndentsPassFactory :
|
||||
TextEditorHighlightingPassFactoryRegistrar, TextEditorHighlightingPassFactory {
|
||||
|
||||
override fun createHighlightingPass(file: PsiFile, editor: Editor): TextEditorHighlightingPass {
|
||||
return RainbowIndentsPass(file.project, editor, file)
|
||||
override fun createHighlightingPass(file: PsiFile, editor: Editor): RainbowIndentsPass? {
|
||||
return when (editor) {
|
||||
is ImaginaryEditor -> null
|
||||
else -> RainbowIndentsPass(file.project, editor, file)
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerHighlightingPassFactory(registrar: TextEditorHighlightingPassRegistrar, project: Project) {
|
||||
|
Loading…
Reference in New Issue
Block a user