rename "i" so textEditor can use it

rename variables “i” and “j” to allow textEditor to use these two
variables without interfering with main.js code.