package org.vaadin.aceeditor;

import java.util.HashMap;

/**
 * Ace mode defines the language used in the editor.
 * 
 */
public enum AceMode {
	abap,
	actionscript,
	ada,
	apache_conf,
	asciidoc,
	assembly_x86,
	autohotkey,
	batchfile,
	c9search,
	clojure,
	cobol,
	coffee,
	coldfusion,
	csharp,
	css,
	curly,
	c_cpp,
	d,
	dart,
	diff,
	django,
	dot,
	ejs,
	erlang,
	forth,
	ftl,
	glsl,
	golang,
	groovy,
	haml,
	handlebars,
	haskell,
	haxe,
	html,
	html_completions,
	html_ruby,
	ini,
	jack,
	jade,
	java,
	javascript,
	json,
	jsoniq,
	jsp,
	jsx,
	julia,
	latex,
	less,
	liquid,
	lisp,
	livescript,
	logiql,
	lsl,
	lua,
	luapage,
	lucene,
	makefile,
	markdown,
	matlab,
	mel,
	mushcode,
	mushcode_high_rules,
	mysql,
	nix,
	objectivec,
	ocaml,
	pascal,
	perl,
	pgsql,
	php,
	plain_text,
	powershell,
	prolog,
	properties,
	protobuf,
	python,
	r,
	rdoc,
	rhtml,
	ruby,
	rust,
	sass,
	scad,
	scala,
	scheme,
	scss,
	sh,
	sjs,
	snippets,
	soy_template,
	space,
	sql,
	stylus,
	svg,
	tcl,
	tex,
	text,
	textile,
	toml,
	twig,
	typescript,
	vbscript,
	velocity,
	verilog,
	vhdl,
	xml,
	xquery,
	yaml;

	public static AceMode forFile(String filename) {
		int lastDot = filename.lastIndexOf(".");
		if (lastDot == -1) {
			return text;
		}
		return forFileEnding(filename.substring(lastDot + 1).toLowerCase());
	}
	
	private static HashMap<String, AceMode> endingModeMap = new HashMap<String, AceMode>();
	static {
		endingModeMap.put("js", javascript);
		endingModeMap.put("json", json);
		endingModeMap.put("c", c_cpp);
		endingModeMap.put("cpp", c_cpp);
		endingModeMap.put("cc", c_cpp);
		endingModeMap.put("h", c_cpp);
		endingModeMap.put("hpp", c_cpp);
		endingModeMap.put("hh", c_cpp);
		endingModeMap.put("java", java);
		endingModeMap.put("py", python);
		endingModeMap.put("tex", latex);
		endingModeMap.put("css", css);
        endingModeMap.put("xml", xml);
        endingModeMap.put("txt", text);
		// TODO: more
	}

	/**
	 * 
	 * @param ending, example: "js"
	 */
	public static AceMode forFileEnding(String ending) {
		AceMode mode = endingModeMap.get(ending);
		return mode!=null ? mode : text;
	}

}

@@ -1956,32 +1956,26 @@
 ss%22, css);%0D%0A
-        
+%09%09
 endingModeMa
@@ -1998,16 +1998,10 @@
 );%0D%0A
-        
+%09%09
 endi

Update AceMode.java