609 elif line0.startswith("index: "): |
609 elif line0.startswith("index: "): |
610 bindName = "dummy.diff" |
610 bindName = "dummy.diff" |
611 elif line0.startswith("\\documentclass"): |
611 elif line0.startswith("\\documentclass"): |
612 bindName = "dummy.tex" |
612 bindName = "dummy.tex" |
613 |
613 |
614 # check filetype |
|
615 if not bindName and self.filetype: |
614 if not bindName and self.filetype: |
616 if self.filetype in ["Python", "Python2"]: |
615 # check filetype |
|
616 from . import Lexers |
|
617 supportedLanguages = Lexers.getSupportedLanguages() |
|
618 if self.filetype in supportedLanguages: |
|
619 bindName = supportedLanguages[self.filetype][1] |
|
620 elif self.filetype in ["Python", "Python2", "Python3"]: |
617 bindName = "dummy.py" |
621 bindName = "dummy.py" |
618 elif self.filetype == "Python3": |
622 |
619 bindName = "dummy.py" |
|
620 elif self.filetype == "Ruby": |
|
621 bindName = "dummy.rb" |
|
622 elif self.filetype == "D": |
|
623 bindName = "dummy.d" |
|
624 elif self.filetype == "Properties": |
|
625 bindName = "dummy.ini" |
|
626 elif self.filetype == "JavaScript": |
|
627 bindName = "dummy.js" |
|
628 |
|
629 # #! marker detection |
|
630 if not bindName and line0.startswith("#!"): |
623 if not bindName and line0.startswith("#!"): |
|
624 # #! marker detection |
631 if "python3" in line0: |
625 if "python3" in line0: |
632 bindName = "dummy.py" |
626 bindName = "dummy.py" |
633 self.filetype = "Python3" |
627 self.filetype = "Python3" |
634 elif "python2" in line0: |
628 elif "python2" in line0: |
635 bindName = "dummy.py" |
629 bindName = "dummy.py" |