Interesting piece of work - 2 related scroll problems.
When you paste a long piece of text in your editor:
- the palette doesn't position near the text where you double click (it remains at the top of the document)
- any undo action, which change text below the fold doesn't scroll the editor where the change occurs.
Good luck with that promising project. Most people who took the contenteditable route to build an editor (ace and codemirror for instance), eventually decided to fully implement the editor themselves...