Simplified the scroll up procedure. Scroll up is only called once; after the byte is written and before the cursor position is set. This changes the behavior a bit, before it would scroll up if the byte being written was to be on the next position outside the buffer, now it scrolls up if the next character written will be outside the buffer. This also fixes an issue where the cursor would be hidden if the next byte position was outside the buffer.
Simplified the scroll up procedure. Scroll up is only called once; after the byte is written and before the cursor position is set. This changes the behavior a bit, before it would scroll up if the byte being written was to be on the next position outside the buffer, now it scrolls up if the next character written will be outside the buffer. This also fixes an issue where the cursor would be hidden if the next byte position was outside the buffer.