a few javascript code to make a textarea act more like a code editor