mozilla/friendlycode — pull request #172 by Pomax (2013-01-18 20:18:09+00:00)
Title: Codeformatting 161

This fixes tabs at 2 spaces, and replaces tabulation codes inserted by the tab key with two spaces, as well. The replacement code is an undocumented use of replaceSelection/2 in CodeMirror, but it was suggested by Marijn in https://groups.google.com/forum/?fromgroups=#!topic/codemirror/E9ti769jBng so thats pretty much the highest authority we can rely on. It replaces the insertion from "tab" with the two spaces, then cancels the "text select" that the replaceSelection call usually effects.