QScintilla/Editor.py

changeset 6722
c58295e218b7
parent 6645
ad476851d7e0
child 6735
31e263d49c04
--- a/QScintilla/Editor.py	Sun Feb 10 17:05:14 2019 +0100
+++ b/QScintilla/Editor.py	Sun Feb 10 16:53:42 2019 +0100
@@ -611,23 +611,17 @@
         elif line0.startswith("\\documentclass"):
             bindName = "dummy.tex"
         
-        # check filetype
         if not bindName and self.filetype:
-            if self.filetype in ["Python", "Python2"]:
-                bindName = "dummy.py"
-            elif self.filetype == "Python3":
+            # check filetype
+            from . import Lexers
+            supportedLanguages = Lexers.getSupportedLanguages()
+            if self.filetype in supportedLanguages:
+                bindName = supportedLanguages[self.filetype][1]
+            elif self.filetype in ["Python", "Python2", "Python3"]:
                 bindName = "dummy.py"
-            elif self.filetype == "Ruby":
-                bindName = "dummy.rb"
-            elif self.filetype == "D":
-                bindName = "dummy.d"
-            elif self.filetype == "Properties":
-                bindName = "dummy.ini"
-            elif self.filetype == "JavaScript":
-                bindName = "dummy.js"
-        
-        # #! marker detection
+        
         if not bindName and line0.startswith("#!"):
+            # #! marker detection
             if "python3" in line0:
                 bindName = "dummy.py"
                 self.filetype = "Python3"

eric ide

mercurial