added tab-as-spaces replacement for the codemirror textarea #173

wants to merge 1 commit into from

1 participant


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!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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment