Fix editor scroll depending on cursor location

Closes #4027 

May need a check from @PaulAdamDavis to make sure the padding removal's okay.