mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[R] decouple R from visualization module
Use RNotebookAppearance instead of abstract notebook appearance GitOrigin-RevId: 0d6364c8bbb646c1c325b06e8666ae956222bc8f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b1a58215ae
commit
e3ecc3ce36
@@ -4,7 +4,6 @@ package com.intellij.notebooks.ui.visualization
|
||||
import com.intellij.notebooks.ui.visualization.NotebookEditorAppearance.Companion.NOTEBOOK_APPEARANCE_KEY
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.EditorKind
|
||||
import com.intellij.openapi.editor.colors.EditorColors
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
import java.awt.Graphics
|
||||
import java.awt.Rectangle
|
||||
@@ -41,23 +40,4 @@ object NotebookUtil {
|
||||
|
||||
actionBetweenBackgroundAndStripe()
|
||||
}
|
||||
|
||||
fun paintCaretRow(editor: EditorImpl, g: Graphics, lines: IntRange) {
|
||||
if (editor.settings.isCaretRowShown) {
|
||||
val caretModel = editor.caretModel
|
||||
val caretLine = caretModel.logicalPosition.line
|
||||
if (caretLine in lines) {
|
||||
g.color = editor.colorsScheme.getColor(EditorColors.CARET_ROW_COLOR)
|
||||
g.fillRect(
|
||||
0,
|
||||
editor.visualLineToY(caretModel.visualPosition.line),
|
||||
g.clipBounds.width,
|
||||
editor.lineHeight
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.intellij.notebooks.ui.visualization.markerRenderers
|
||||
|
||||
import com.intellij.notebooks.ui.visualization.NotebookUtil.paintCaretRow
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
import com.intellij.openapi.editor.markup.RangeHighlighter
|
||||
import java.awt.Graphics
|
||||
import java.awt.Rectangle
|
||||
|
||||
class NotebookTextCellBackgroundLineMarkerRenderer(private val highlighter: RangeHighlighter) : NotebookLineMarkerRenderer() {
|
||||
override fun paint(editor: Editor, g: Graphics, r: Rectangle) {
|
||||
editor as EditorImpl
|
||||
|
||||
val lines = IntRange(editor.document.getLineNumber(highlighter.startOffset), editor.document.getLineNumber(highlighter.endOffset))
|
||||
|
||||
paintCaretRow(editor, g, lines)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user