Sun, 04 Nov 2018 12:38:32 +0100
Shell: another attempt to properly fix the 'writing prompt' issue.
--- a/Documentation/Source/eric6.QScintilla.Shell.html Sun Nov 04 11:46:35 2018 +0100 +++ b/Documentation/Source/eric6.QScintilla.Shell.html Sun Nov 04 12:38:32 2018 +0100 @@ -309,7 +309,7 @@ <td>Private method to write a banner with info from the debug client.</td> </tr><tr> <td><a href="#Shell.__writePrompt">__writePrompt</a></td> -<td>Private method to write the prompt.</td> +<td>Private method to write the prompt using a write queue.</td> </tr><tr> <td><a href="#Shell.__writeQueued">__writeQueued</a></td> <td>Private method to display some text using a write queue.</td> @@ -1150,7 +1150,7 @@ <h4>Shell.__writePrompt</h4> <b>__writePrompt</b>(<i></i>) <p> - Private method to write the prompt. + Private method to write the prompt using a write queue. </p><a NAME="Shell.__writeQueued" ID="Shell.__writeQueued"></a> <h4>Shell.__writeQueued</h4> <b>__writeQueued</b>(<i>s</i>)
--- 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): """