fix firstLine when modifying lines above it (fixes #2654)

Fix for #2654.

Fixed behavior when modifying lines above `firstLine`, the behavior is now like that of common text editors.

What would happen is `firstLine` would become negative and the next time `documentChanged` is triggered the `firstLine` would then be properly set and the text editor redrawn.

I'm not a wizard yet but setting firstLine to be a negative number sounds like witchcraft. I've added an exception to `setFirstLine()`.