eric6/QScintilla/Editor.py

changeset 8131
f2129bb79269
parent 8106
81bf8fe10735
child 8142
43248bafe9b2
child 8143
2c730d5fd177
--- a/eric6/QScintilla/Editor.py	Tue Feb 23 17:31:36 2021 +0100
+++ b/eric6/QScintilla/Editor.py	Tue Feb 23 17:38:12 2021 +0100
@@ -171,21 +171,29 @@
     }
     
     def __init__(self, dbs, fn="", vm=None,
-                 filetype="", editor=None, tv=None):
+                 filetype="", editor=None, tv=None,
+                 parent=None):
         """
         Constructor
         
         @param dbs reference to the debug server object
-        @param fn name of the file to be opened (string). If it is None,
-                a new (empty) editor is opened
+        @type DebugServer
+        @param fn name of the file to be opened. If it is None, a new (empty)
+            editor is opened.
+        @type str
         @param vm reference to the view manager object
-            (ViewManager.ViewManager)
-        @param filetype type of the source file (string)
+        @type ViewManager
+        @param filetype type of the source file
+        @type str
         @param editor reference to an Editor object, if this is a cloned view
+        @type Editor
         @param tv reference to the task viewer object
+        @type TaskViewer
+        @param parent reference to the parent widget
+        @type QWidget
         @exception OSError raised to indicate an issue accessing the file
         """
-        super(Editor, self).__init__()
+        super(Editor, self).__init__(parent)
         self.setAttribute(Qt.WA_KeyCompression)
         self.setUtf8(True)
         
@@ -1761,7 +1769,7 @@
                 pyVer = Utilities.determinePythonVersion(
                     filename, self.text(0), self)
                 language = "Python{0}".format(pyVer)
-            if language in ['Python3', 'MicroPython', 'Ruby',
+            if language in ['Python3', 'MicroPython', 'Cython', 'Ruby',
                             'JavaScript', 'YAML', 'JSON']:
                 self.filetype = language
             else:
@@ -2102,6 +2110,18 @@
             return True
         
         return False
+    
+    def isCythonFile(self):
+        """
+        Public method to return a flag indicating a Cython file.
+        
+        @return flag indicating a Cython file
+        @rtype bool
+        """
+        if self.filetype == "Cython":
+            return True
+        
+        return False
 
     def isRubyFile(self):
         """

eric ide

mercurial