[jupyter] PY-73182 diff - removed foldings and run cell button from diff editor

GitOrigin-RevId: bcefd96f008e15d89b6986b1fbd287dcae1c2eab
This commit is contained in:
Bogdan.Kirilenko
2024-06-10 13:26:09 +02:00
committed by intellij-monorepo-bot
parent 4a95631c5d
commit 7761458200
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package org.jetbrains.plugins.notebooks.visualization.ui
import com.intellij.openapi.editor.EditorKind
import com.intellij.openapi.editor.ex.EditorEx
import org.jetbrains.plugins.notebooks.ui.isFoldingEnabledKey
@@ -8,7 +9,7 @@ class EditorCellFolding(editor: EditorEx, toggleListener: () -> Unit) {
private val foldingBar: EditorCellFoldingBar?
init {
val isFoldingEnabled = editor.getUserData(isFoldingEnabledKey) ?: false
val isFoldingEnabled = (editor.getUserData(isFoldingEnabledKey) ?: false && editor.editorKind != EditorKind.DIFF)
if (isFoldingEnabled) {
foldingBar = EditorCellFoldingBar(editor, toggleListener)
}

View File

@@ -1,5 +1,6 @@
package org.jetbrains.plugins.notebooks.visualization.ui
import com.intellij.openapi.editor.EditorKind
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.editor.markup.HighlighterLayer
import com.intellij.openapi.editor.markup.HighlighterTargetArea
@@ -12,9 +13,10 @@ class EditorCellRunButton(private val editor: EditorEx) {
private var cellRangeHighlighter: RangeHighlighter? = null
fun showRunButton(interval: NotebookCellLines.Interval) {
if (editor.editorKind == EditorKind.DIFF) return
hideRunButton()
if (interval.type != NotebookCellLines.CellType.CODE) return
if (interval.type != NotebookCellLines.CellType.CODE) return // PY-73182
val linesRange = interval.lines
val sourceStartOffset = editor.document.getLineEndOffset(interval.lines.first)