Skip to content

Commit

Permalink
Fix crash in processing script editor when text is changed programati…
Browse files Browse the repository at this point in the history
…cally
  • Loading branch information
nyalldawson committed Mar 20, 2023
1 parent 8a3ab39 commit 6c8bda7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/script/ScriptEditorDialog.py
Expand Up @@ -122,7 +122,7 @@ def __init__(self, filePath=None, parent=None):
self.actionIncreaseFontSize.triggered.connect(self.editor.zoomIn)
self.actionDecreaseFontSize.triggered.connect(self.editor.zoomOut)
self.actionToggleComment.triggered.connect(self.editor.toggleComment)
self.editor.textChanged.connect(lambda: self.setHasChanged(True))
self.editor.textChanged.connect(self._on_text_modified)

self.leFindText.returnPressed.connect(self.find)
self.btnFind.clicked.connect(self.find)
Expand Down Expand Up @@ -229,6 +229,9 @@ def saveScript(self, saveAs):

QgsApplication.processingRegistry().providerById("script").refreshAlgorithms()

def _on_text_modified(self):
self.setHasChanged(True)

def setHasChanged(self, hasChanged):
self.hasChanged = hasChanged
self.actionSaveScript.setEnabled(hasChanged)
Expand Down

0 comments on commit 6c8bda7

Please sign in to comment.