We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a8539a commit ce1683fCopy full SHA for ce1683f
Orange/widgets/data/owpythonscript.py
@@ -194,14 +194,13 @@ def pasteFile(self, url):
194
replace = dialog_replace_append(filename)
195
if replace is None: # cancel
196
return
197
- if replace: # replace
198
- self.document().setPlainText(new)
+ cursor = QTextCursor(self.document())
+ if replace:
199
+ cursor.select(QTextCursor.Document)
200
+ cursor.insertText(new)
201
else: # append
- self.document().setPlainText(
- current_text +
202
- ("\n" if not current_text.endswith("\n") else "") +
203
- new)
204
- self.document().setModified(True)
+ cursor.movePosition(QTextCursor.End)
205
206
207
class PythonConsole(QPlainTextEdit, code.InteractiveConsole):
0 commit comments