fix: user action may change cursor insert point
See BUG: 464234 to reproduce the bug.
The history panel relies on Cursor's position to insert text.
Although the cursor is hidden, user actions like clicking or selecting will change the cursor's location.
Thus new str will be inserted to the new cursor location.
We want to track the cursor location when inserting new str.
So, we keep a textCursor when inserting str finished, and when adding new str, we set the textCursor to the previous position.
Note that this.textCursor()->setPosition()
does nothing. this.textCursor()
doesn't return a pointer to the internal cursor (which has no direct way to interact with).
Edited by shenleban tongying