QScintilla/Shell.py

changeset 6580
082d58e2415e
parent 6578
2fb729cca297
child 6581
8eb6220f2bb7
--- a/QScintilla/Shell.py	Sun Nov 04 11:46:35 2018 +0100
+++ b/QScintilla/Shell.py	Sun Nov 04 12:38:32 2018 +0100
@@ -825,16 +825,10 @@
         
     def __writePrompt(self):
         """
-        Private method to write the prompt.
+        Private method to write the prompt using a write queue.
         """
-        # get all queued text first by forcing the -_concatenateText() to run
-        self.__concatenateText("")
-        
-        self.__write(self.inContinue and sys.ps2 or sys.ps1)
-        # little trick to get the cursor position registered within QScintilla
-        self.SendScintilla(QsciScintilla.SCI_CHARLEFT)
-        self.SendScintilla(QsciScintilla.SCI_CHARRIGHT)
-        
+        self.queueText.emit(self.inContinue and sys.ps2 or sys.ps1)
+    
     def __clientStatement(self, more):
         """
         Private method to handle the response from the debugger client.
@@ -845,7 +839,7 @@
             self.inContinue = more
             self.__writePrompt()
         self.inCommandExecution = False
-        
+    
     def __clientException(self, exceptionType, exceptionMessage, stackTrace):
         """
         Private method to handle an exception of the client.
@@ -969,6 +963,10 @@
         
         self.__queuedText = ''
         self.__blockTextProcessing = False
+        
+        # little trick to get the cursor position registered within QScintilla
+        self.SendScintilla(QsciScintilla.SCI_CHARLEFT)
+        self.SendScintilla(QsciScintilla.SCI_CHARRIGHT)
 
     def __write(self, s):
         """

eric ide

mercurial