As for the caret positioning.
1) Solution 1: remember position as a count of characters from the beginning. You can use functions from
RVLineaer: RVGetSelection/RVSetSelection, RVGetSelectionEx/RVSetSelectionEx, RVGetLinearCaretPos/RVSetLinearCaretPost.
However, these functions are only useful if the count of characters is not changed. InsertColLeft inserts empty cells before the caret position, they are counted as line break characters by the functions from RVLinear, so these functions cannot be used.
2) You can remember the current position as (RVData, position in this rvdata).
uses
CRVData, CRVFData;
var
RVData: TCustomRVData;
ItemNo1, Offs1, ItemNo2, Offs2: Integer;
store:
RVData := RichViewEdit1.TopLevelEditor.RVData.GetSourceRVData;
TCustomRVFormattedData(RVData).GetSelectionBoundsEx(ItemNo1, Off1, ItemNo2, Offs2, False);
restore:
RVData := RVData.Edit;
TCustomRVFormattedData(RVData).SetSelectionBounds(ItemNo1, Off1, ItemNo2, Offs2);
The second method is useful if the cell is not deleted between store and restore.