Fix editor scroll depending on cursor location

Closes #4027
Merge pull request #4034 from novaugust/iss4027

Fix editor scroll depending on cursor location