Cursor problem should be fixed by 84b4f37, i wasn't seeing it because i had only one linewidget and no folded or wrapped lines.

Fixing behavior when adding removing lines is trickier. Now it's done in https://github.com/ajaxorg/ace/pull/1572/files#L3R116, but different types of widgets have different requirements.