updating the patch - still need better handling of the resize and caret position/scroll.