File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from spyder .plugins .editor .widgets .codeeditor import CodeEditor
6
6
from PyQt5 .QtCore import pyqtSignal , QFileSystemWatcher , QTimer
7
- from PyQt5 .QtWidgets import QAction , QFileDialog
7
+ from PyQt5 .QtWidgets import QAction , QFileDialog , QApplication
8
8
from PyQt5 .QtGui import QFontDatabase , QTextCursor
9
9
from path import Path
10
10
@@ -284,13 +284,15 @@ def _file_changed(self):
284
284
cursor .select (QTextCursor .Document )
285
285
cursor .insertText (file_contents )
286
286
287
+ # The editor will not always update after a text insertion, so we force it
288
+ QApplication .processEvents ()
289
+
287
290
# Stop blocking signals
288
291
self .blockSignals (False )
289
292
290
293
# Restore undo stack availability
291
294
if undo_stack :
292
295
self .document ().setModified (True )
293
- self .document ().undo () # Prevents the need for a double undo
294
296
295
297
# Restore the cursor position and selection
296
298
cursor .setPosition (anchor_position )
You can’t perform that action at this time.
0 commit comments