mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[jupyter] PY-73182 diff - removed foldings and run cell button from diff editor
GitOrigin-RevId: bcefd96f008e15d89b6986b1fbd287dcae1c2eab
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4a95631c5d
commit
7761458200
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user