Update style so it doesn't shift cursor to the right
Fix bug: code crashing when main editor is null