mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:41:47 +07:00
[PyCharm] Jupyter (fix): Fixed wrong RangeHighlighter recreation on cell bounds change. #PY-77353 Fixed
(cherry picked from commit 4e2cb72b483757933def97f4f7975622f2bf45b8) GitOrigin-RevId: a45fabafdf312651051693a882aab3b38fd88156
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5f371fb815
commit
a9ce4d15f3
@@ -77,8 +77,8 @@ class EditorCellView(
|
||||
|
||||
private var mouseOver = false
|
||||
|
||||
// We are storing last offsets for highlighters to prevent highlighters unnecessary recreation on same values.
|
||||
private var lastHighLightersOffsets: IntRange? = null
|
||||
// We are storing last lines range for highlighters to prevent highlighters unnecessary recreation on same lines.
|
||||
private var lastHighLightersLines: IntRange? = null
|
||||
|
||||
var disableActions: Boolean = false
|
||||
set(value) {
|
||||
@@ -144,8 +144,8 @@ class EditorCellView(
|
||||
DataManager.removeDataProvider(component)
|
||||
DataManager.registerDataProvider(component, NotebookCellDataProvider(editor, component) { interval })
|
||||
}
|
||||
controller.createGutterRendererLineMarker(editor, interval, cellView = this)
|
||||
}
|
||||
updateCellHighlight()
|
||||
}
|
||||
|
||||
private fun recreateControllers() {
|
||||
@@ -176,8 +176,8 @@ class EditorCellView(
|
||||
|
||||
private fun isInlaysBroken(): Boolean {
|
||||
val inlaysOffsets = buildSet {
|
||||
add(editor.document.getLineStartOffset(interval.lines.first))
|
||||
add(editor.document.getLineEndOffset(interval.lines.last))
|
||||
add(editor.document.getLineStartOffset(interval.lines.first))
|
||||
add(editor.document.getLineEndOffset(interval.lines.last))
|
||||
}
|
||||
for (inlay in getInlays()) {
|
||||
if (!inlay.isValid || inlay.offset !in inlaysOffsets) {
|
||||
@@ -280,11 +280,10 @@ class EditorCellView(
|
||||
val startOffset = editor.document.getLineStartOffset(interval.lines.first)
|
||||
val endOffset = editor.document.getLineEndOffset(interval.lines.last)
|
||||
|
||||
val range = IntRange(startOffset, endOffset)
|
||||
if (interval.lines == lastHighLightersOffsets) {
|
||||
if (interval.lines == lastHighLightersLines) {
|
||||
return
|
||||
}
|
||||
lastHighLightersOffsets = range
|
||||
lastHighLightersLines = IntRange(interval.lines.first, interval.lines.last)
|
||||
|
||||
removeCellHighlight()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user