mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
PY-74088 Jupyter(fix): inline variable previews don't work
GitOrigin-RevId: 7907cb9f08d9a340983353591c12d4590577592c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3c5b6a8592
commit
3dbe588eb0
@@ -6,9 +6,6 @@ import com.intellij.openapi.client.ClientSystemInfo
|
|||||||
import com.intellij.openapi.editor.Caret
|
import com.intellij.openapi.editor.Caret
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.editor.event.*
|
import com.intellij.openapi.editor.event.*
|
||||||
import com.intellij.openapi.editor.event.EditorMouseEvent
|
|
||||||
import com.intellij.openapi.editor.event.EditorMouseEventArea
|
|
||||||
import com.intellij.openapi.editor.event.EditorMouseListener
|
|
||||||
import com.intellij.openapi.editor.ex.EditorEx
|
import com.intellij.openapi.editor.ex.EditorEx
|
||||||
import com.intellij.openapi.editor.ex.util.EditorScrollingPositionKeeper
|
import com.intellij.openapi.editor.ex.util.EditorScrollingPositionKeeper
|
||||||
import com.intellij.openapi.editor.impl.EditorComponentImpl
|
import com.intellij.openapi.editor.impl.EditorComponentImpl
|
||||||
@@ -66,16 +63,19 @@ private class DecoratedEditor(private val original: TextEditor, private val mana
|
|||||||
original.editor.addEditorMouseListener(object : EditorMouseListener {
|
original.editor.addEditorMouseListener(object : EditorMouseListener {
|
||||||
override fun mousePressed(event: EditorMouseEvent) {
|
override fun mousePressed(event: EditorMouseEvent) {
|
||||||
if (!event.isConsumed && event.mouseEvent.button == MouseEvent.BUTTON1) {
|
if (!event.isConsumed && event.mouseEvent.button == MouseEvent.BUTTON1) {
|
||||||
getEditorPoint(event.mouseEvent)?.let { (_, point) ->
|
val point = getEditorPoint(event.mouseEvent)?.second ?: return
|
||||||
val selectedCell = getCellViewByPoint(point)?.cell ?: return
|
|
||||||
if (event.area == EditorMouseEventArea.EDITING_AREA && event.inlay == null) {
|
val selectedCell = getCellViewByPoint(point)?.cell ?: return
|
||||||
editor.setMode(NotebookEditorMode.EDIT)
|
|
||||||
}
|
if (event.area == EditorMouseEventArea.EDITING_AREA && event.inlay == null) {
|
||||||
else {
|
editor.setMode(NotebookEditorMode.EDIT)
|
||||||
editor.setMode(NotebookEditorMode.COMMAND)
|
|
||||||
}
|
|
||||||
mousePressed(selectedCell.interval, event.isCtrlPressed(), event.isShiftPressed())
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
editor.setMode(NotebookEditorMode.COMMAND)
|
||||||
|
}
|
||||||
|
if (event.area != EditorMouseEventArea.EDITING_AREA)
|
||||||
|
mousePressed(selectedCell.interval, event.isCtrlPressed(), event.isShiftPressed())
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
@@ -104,7 +104,8 @@ private class DecoratedEditor(private val original: TextEditor, private val mana
|
|||||||
SwingUtilities.invokeLater {
|
SwingUtilities.invokeLater {
|
||||||
try {
|
try {
|
||||||
updateSelectionByCarets()
|
updateSelectionByCarets()
|
||||||
} finally {
|
}
|
||||||
|
finally {
|
||||||
selectionUpdateScheduled.set(false)
|
selectionUpdateScheduled.set(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user