diff -r bad78a592cc2 -r fcb6b4b96274 eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py --- a/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Tue Apr 13 17:49:05 2021 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Tue Apr 13 18:02:59 2021 +0200 @@ -167,10 +167,8 @@ @rtype tuple of (int, int) """ itm = self.styleElementList.currentItem() - if itm is None: - styles = (0, -1) # return default style - else: - styles = self.__stylesForItem(itm) + # return default style, if no current item + styles = (0, -1) if itm is None else self.__stylesForItem(itm) return styles