mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[PyCharm] PY-75896 minor - fixing "compare with" appearance for ipynb files
GitOrigin-RevId: a5215a5c8b1c1159c965db8b5cb1e447d4608497
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e1b986987d
commit
2175e17d51
+6
-2
@@ -1,6 +1,7 @@
|
||||
package com.intellij.notebooks.ui.visualization
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.notebooks.ui.visualization.NotebookEditorAppearanceUtils.isDiffKind
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
@@ -130,7 +131,7 @@ class NotebookBelowCellDelimiterPanel(
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
val event = AnActionEvent.createFromAnAction(action, null, ActionPlaces.EDITOR_INLAY, dataContext)
|
||||
val event = AnActionEvent.createEvent(action, dataContext, null, ActionPlaces.EDITOR_INLAY, ActionUiKind.NONE, null)
|
||||
action.actionPerformed(event)
|
||||
}
|
||||
}
|
||||
@@ -155,7 +156,10 @@ class NotebookBelowCellDelimiterPanel(
|
||||
fun updateExecutionStatus(
|
||||
@NlsSafe tooltipText: String?, executionCount: Int?, statusIcon: Icon?, @NlsSafe executionDurationText: String?
|
||||
) {
|
||||
val showStatus = isExecutionCountDefined(executionCount) || (tooltipText != null && statusIcon != AllIcons.General.GreenCheckmark)
|
||||
|
||||
val showStatus = (isExecutionCountDefined(executionCount) || (tooltipText != null && statusIcon != AllIcons.General.GreenCheckmark))
|
||||
&& !editor.isDiffKind()
|
||||
|
||||
if (showStatus) {
|
||||
getOrCreateExecutionLabel().apply {
|
||||
text = getExecutionLabelText(executionCount, executionDurationText)
|
||||
|
||||
+1
-3
@@ -9,14 +9,12 @@ object NotebookEditorAppearanceUtils {
|
||||
val JUPYTER_HISTORY_EDITOR_KEY = Key.create<Boolean>("JUPYTER_HISTORY_EDITOR_KEY")
|
||||
|
||||
fun getJupyterCellSpacing(editor: Editor): Int = editor.getLineHeight()
|
||||
|
||||
fun EditorKind.isDiff(): Boolean = this === EditorKind.DIFF
|
||||
fun Editor.isDiffKind(): Boolean = this.editorKind == EditorKind.DIFF
|
||||
|
||||
fun Editor.isOrdinaryNotebookEditor() = when {
|
||||
this.editorKind != EditorKind.MAIN_EDITOR -> false
|
||||
this.getUserData(JUPYTER_HISTORY_EDITOR_KEY) == true -> false
|
||||
else -> true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user