--- 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: