--- a/eric6/QScintilla/Lexers/LexerPython.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerPython.py Wed Apr 21 19:40:50 2021 +0200 @@ -181,14 +181,13 @@ if m: last -= indent_width - if ( - lead_spaces % indent_width != 0 or - lead_spaces == 0 or - self.lastIndented != line - ): - indentDifference = last - lead_spaces - else: - indentDifference = -indent_width + indentDifference = ( + last - lead_spaces + if (lead_spaces % indent_width != 0 or + lead_spaces == 0 or + self.lastIndented != line) else + -indent_width + ) return indentDifference