QScintilla/Editor.py

changeset 2221
f72f8b0478cb
parent 2219
031fae60d778
child 2261
f4bb5648fc29
--- a/QScintilla/Editor.py	Mon Nov 12 13:12:07 2012 +0100
+++ b/QScintilla/Editor.py	Mon Nov 12 14:42:48 2012 +0100
@@ -501,10 +501,17 @@
         @param line0 first line of text to use in the generation process (string)
         """
         bindName = ""
-        
-        if line0.startswith("<?xml"):
-            # override extension for XML files
+        line0 = line0.lower()
+        
+        # check first line if it does not start with #!
+        if line0.startswith(("<html", "<!doctype html", "<?php")):
+            bindName = "dummy.html"
+        elif line0.startswith(("<?xml", "<!doctype")):
             bindName = "dummy.xml"
+        elif line0.startswith("index: "):
+            bindName = "dummy.diff"
+        elif line0.startswith("\\documentclass"):
+            bindName = "dummy.tex"
         
         # check filetype
         if not bindName and self.filetype:

eric ide

mercurial