Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions opencodeblocks/blocks/codeblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@

from typing import OrderedDict, Optional
from PyQt5.QtWidgets import (
QApplication,
QPushButton,
QTextEdit,
QWidget,
QStyleOptionGraphicsItem,
)
from PyQt5.QtCore import QTimer, Qt
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPen, QColor, QPainter, QPainterPath

from ansi2html import Ansi2HTMLConverter

from opencodeblocks.blocks.block import OCBBlock

from opencodeblocks.blocks.executableblock import OCBExecutableBlock
from opencodeblocks.graphics.socket import OCBSocket
from opencodeblocks.graphics.pyeditor import PythonEditor

conv = Ansi2HTMLConverter()
Expand Down Expand Up @@ -209,6 +207,10 @@ def source(self) -> str:
@source.setter
def source(self, value: str):
if value != self._source:
# If text has changed, set self and all output blocks to not run
output_blocks, _ = self.custom_bfs(self, reverse=True)
for block in output_blocks:
block.has_been_run = False
self.has_been_run = False
self.source_editor.setText(value)
self._source = value
Expand Down