Fix scrollbar bug,
where text selection would be lost when document was scrolled.
Fixed horrible bug that caused crash when user held ctrl-v