eric6/QScintilla/Exporters/ExporterTEX.py

changeset 7267
aedc309827c7
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/QScintilla/Exporters/ExporterTEX.py	Wed Sep 25 18:25:43 2019 +0200
+++ b/eric6/QScintilla/Exporters/ExporterTEX.py	Wed Sep 25 18:37:35 2019 +0200
@@ -131,15 +131,21 @@
                 "TeX/FullPathAsTitle")
             
             lex = self.editor.getLexer()
-            self.defaultPaper = lex and \
-                lex.paper(QsciScintilla.STYLE_DEFAULT) or \
+            self.defaultPaper = (
+                lex and
+                lex.paper(QsciScintilla.STYLE_DEFAULT) or
                 self.editor.paper().name()
-            self.defaultColor = lex and \
-                lex.color(QsciScintilla.STYLE_DEFAULT) or \
+            )
+            self.defaultColor = (
+                lex and
+                lex.color(QsciScintilla.STYLE_DEFAULT) or
                 self.editor.color().name()
-            self.defaultFont = lex and \
-                lex.color(QsciScintilla.STYLE_DEFAULT) or \
+            )
+            self.defaultFont = (
+                lex and
+                lex.color(QsciScintilla.STYLE_DEFAULT) or
                 Preferences.getEditorOtherFonts("DefaultFont")
+            )
             
             lengthDoc = self.editor.length()
             styleIsUsed = {}
@@ -173,11 +179,15 @@
                 if lex:
                     istyle = 0
                     while istyle <= QsciScintilla.STYLE_MAX:
-                        if (istyle <= QsciScintilla.STYLE_DEFAULT or
-                            istyle > QsciScintilla.STYLE_LASTPREDEFINED) and \
-                           styleIsUsed[istyle]:
-                            if lex.description(istyle) or \
-                               istyle == QsciScintilla.STYLE_DEFAULT:
+                        if (
+                            (istyle <= QsciScintilla.STYLE_DEFAULT or
+                             istyle > QsciScintilla.STYLE_LASTPREDEFINED) and
+                            styleIsUsed[istyle]
+                        ):
+                            if (
+                                lex.description(istyle) or
+                                istyle == QsciScintilla.STYLE_DEFAULT
+                            ):
                                 font = lex.font(istyle)
                                 colour = lex.color(istyle)
                                 paper = lex.paper(istyle)
@@ -233,8 +243,10 @@
                         f.write("\\{0}".format(ch[0]))
                     elif ch in [b'\r', b'\n']:
                         lineIdx = -1    # because incremented below
-                        if ch == b'\r' and \
-                                self.editor.byteAt(pos + 1) == b'\n':
+                        if (
+                            ch == b'\r' and
+                            self.editor.byteAt(pos + 1) == b'\n'
+                        ):
                             pos += 1    # skip the LF
                         styleCurrent = self.editor.styleAt(pos + 1)
                         f.write("}} \\\\\n\\eric{0}{{".format(

eric ide

mercurial