Sun, 05 Nov 2023 17:17:29 +0100
Fixed a few issues introduced by the recent change.
src/eric7/QScintilla/Editor.py | file | annotate | diff | comparison | revisions |
--- a/src/eric7/QScintilla/Editor.py Sun Nov 05 12:05:52 2023 +0100 +++ b/src/eric7/QScintilla/Editor.py Sun Nov 05 17:17:29 2023 +0100 @@ -6656,22 +6656,26 @@ ## Syntax error handling methods below ########################################################################### - def toggleSyntaxError(self, line, index, error, msg="", show=False): + def toggleSyntaxError(self, line, index, setError, msg="", show=False): """ Public method to toggle a syntax error indicator. - @param line line number of the syntax error (integer) - @param index index number of the syntax error (integer) - @param error flag indicating if the error marker should be - set or deleted (boolean) - @param msg error message (string) + @param line line number of the syntax error + @type int + @param index index number of the syntax error + @type int + @param setError flag indicating if the error marker should be + set or deleted + @type bool + @param msg error message + @type str @param show flag indicating to set the cursor to the error position - (boolean) + @type bool """ if line == 0: line = 1 # hack to show a syntax error marker, if line is reported to be 0 - if error: + if setError: # set a new syntax error marker markers = self.markersAtLine(line - 1) index += self.indentation(line - 1) @@ -6742,7 +6746,7 @@ """ Public slot to handle the 'Clear all syntax error' context menu action. """ - for handle in self.syntaxerrors: + for handle in list(self.syntaxerrors.keys()): line = self.markerLine(handle) + 1 self.toggleSyntaxError(line, 0, False) @@ -6803,7 +6807,7 @@ ########################################################################### def toggleWarning( - self, line, col, warning, msg="", warningType=WarningCode # noqa: U100 + self, line, col, setWarning, msg="", warningType=WarningCode # noqa: U100 ): """ Public method to toggle a warning indicator. @@ -6811,16 +6815,21 @@ Note: This method is used to set pyflakes and code style warnings. @param line line number of the warning + @type int @param col column of the warning - @param warning flag indicating if the warning marker should be - set or deleted (boolean) - @param msg warning message (string) - @param warningType type of warning message (integer) + @type int + @param setWarning flag indicating if the warning marker should be + set or deleted + @type bool + @param msg warning message + @type str + @param warningType type of warning message + @type int """ if line == 0: line = 1 # hack to show a warning marker, if line is reported to be 0 - if warning: + if setWarning: # set/amend a new warning marker warn = (msg, warningType) markers = self.markersAtLine(line - 1)