--- a/QScintilla/Editor.py Sun Feb 10 15:58:15 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"