[fx] fix caret position saving