src/eric7/QScintilla/MiniEditor.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9573
9960d19d66b5
diff -r 0b936ff1bbb9 -r a2bc06a54d9d src/eric7/QScintilla/MiniEditor.py
--- a/src/eric7/QScintilla/MiniEditor.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/QScintilla/MiniEditor.py	Mon Nov 07 17:19:58 2022 +0100
@@ -26,7 +26,12 @@
     pyqtSlot,
 )
 from PyQt6.QtGui import QAction, QActionGroup, QFont, QKeySequence, QPalette, QPixmap
-from PyQt6.QtPrintSupport import QAbstractPrintDialog, QPrintDialog, QPrinter
+from PyQt6.QtPrintSupport import (
+    QAbstractPrintDialog,
+    QPrintDialog,
+    QPrinter,
+    QPrintPreviewDialog,
+)
 from PyQt6.QtWidgets import (
     QApplication,
     QDialog,
@@ -50,7 +55,10 @@
 from eric7.Globals import isMacPlatform
 from eric7.UI import Config
 
+from . import Lexers
+from .EditorOutline import EditorOutlineView
 from .QsciScintillaCompat import QsciScintillaCompat
+from .SearchReplaceWidget import SearchReplaceWidget
 
 
 class MiniScintilla(QsciScintillaCompat):
@@ -289,13 +297,9 @@
         self.__lastLine = 0
 
         self.srHistory = {"search": [], "replace": []}
-        from .SearchReplaceWidget import SearchReplaceWidget
-
         self.__searchWidget = SearchReplaceWidget(False, self, self)
         self.__replaceWidget = SearchReplaceWidget(True, self, self)
 
-        from .EditorOutline import EditorOutlineView
-
         self.__sourceOutline = EditorOutlineView(self, populate=False)
         self.__sourceOutline.setMaximumWidth(
             Preferences.getEditor("SourceOutlineWidth")
@@ -538,8 +542,6 @@
         elif language == "":
             pixmap = EricPixmapCache.getPixmap("fileText")
         else:
-            from eric7.QScintilla import Lexers
-
             pixmap = Lexers.getLanguageIcon(language, True)
         self.sbLanguage.setPixmap(pixmap)
         if pixmap.isNull():
@@ -3678,8 +3680,6 @@
         """
         Private slot to show a print preview of the text.
         """
-        from PyQt6.QtPrintSupport import QPrintPreviewDialog
-
         from .Printer import Printer
 
         printer = Printer(mode=QPrinter.PrinterMode.HighResolution)
@@ -3750,8 +3750,6 @@
         self.languagesActGrp.addAction(self.noLanguageAct)
         menu.addSeparator()
 
-        from . import Lexers
-
         self.supportedLanguages = {}
         supportedLanguages = Lexers.getSupportedLanguages()
         languages = sorted(supportedLanguages.keys())
@@ -3807,7 +3805,7 @@
         @return name of the selected pygments lexer
         @rtype str
         """
-        from pygments.lexers import get_all_lexers
+        from pygments.lexers import get_all_lexers  # __IGNORE_WARNING_I102__
 
         lexerList = sorted(lex[0] for lex in get_all_lexers())
         try:
@@ -3963,8 +3961,6 @@
             else:
                 self.filetype = language
 
-        from . import Lexers
-
         self.lexer_ = Lexers.getLexer(language, self.__textEdit, pyname=pyname)
         if self.lexer_ is None:
             self.__textEdit.setLexer()
@@ -4042,8 +4038,6 @@
 
         if not bindName and self.filetype:
             # check filetype
-            from . import Lexers
-
             supportedLanguages = Lexers.getSupportedLanguages()
             if self.filetype in supportedLanguages:
                 bindName = supportedLanguages[self.filetype][1]

eric ide

mercurial