mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
[PyCharm] PY-73583 WIP improved structure view, cell selection reflects in structure
GitOrigin-RevId: c6c9818eb3d7433a4a1dffd5bccd1dd3096456d2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8d8231e4e1
commit
cf6c17e165
@@ -171,6 +171,10 @@ class NotebookCellInlayManager private constructor(
|
||||
val selectedCells = selectionModel.selectedCells.map { it.ordinal }
|
||||
for (cell in cells) {
|
||||
cell.selected = cell.intervalPointer.get()?.ordinal in selectedCells
|
||||
|
||||
if (cell.selected) {
|
||||
editor.project?.messageBus?.syncPublisher(JupyterCellSelectionNotifier.TOPIC)?.cellSelected(cell.interval, editor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jetbrains.plugins.notebooks.visualization.ui
|
||||
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.util.messages.Topic
|
||||
import org.jetbrains.plugins.notebooks.visualization.NotebookCellLines
|
||||
|
||||
interface JupyterCellSelectionNotifier {
|
||||
// todo: probably it's better to merge with some already existing listener
|
||||
companion object {
|
||||
val TOPIC = Topic.create("Jupyter Cell Selection Topic", JupyterCellSelectionNotifier::class.java)
|
||||
}
|
||||
|
||||
fun cellSelected(interval: NotebookCellLines.Interval, editor: Editor)
|
||||
}
|
||||
Reference in New Issue
Block a user