RichViewEdit.InsertText at the start of a paragraph
Posted: Thu Aug 06, 2020 7:35 pm
I am sorting out a situation where I need to do an InsertText at the start of a Paragraph with a space or narrow-width space. After much testing the space or narrow-width space doesn't seem to matter in affecting this.
What happens is that Insert text seems to take over the same line (not whole paragraph) text with the Paragraph Style not the Font style.
Here is the scenario:
1. Delete text at the start of the paragraph using
RichViewEditClean.SetSelectionBounds(rsiNo, rsiOffs, ereiNo, ereiOffs);
RichViewEditClean.DeleteSelection; //This does not actually matter (I've tested it without this)
2. Insert Text
RichViewEditClean.InsertText(' ', True);
3. I insert a checkpint next but this does not seem to affect either if removed
4. Now this line has the paragraph style after the InsertText not the font style.
So a minimal scenario to repeat:
RichViewEditClean.SetSelectionBounds(rsiNo, rsiOffs, ereiNo, ereiOffs); //Make sure it is at the start of a paragraph.
RichViewEditClean.InsertText(' ', True);
//Now the rest of that line changes to Paragraph style.
How can I make it so that Font style is used instead of Paragraph Style in InsertText
What happens is that Insert text seems to take over the same line (not whole paragraph) text with the Paragraph Style not the Font style.
Here is the scenario:
1. Delete text at the start of the paragraph using
RichViewEditClean.SetSelectionBounds(rsiNo, rsiOffs, ereiNo, ereiOffs);
RichViewEditClean.DeleteSelection; //This does not actually matter (I've tested it without this)
2. Insert Text
RichViewEditClean.InsertText(' ', True);
3. I insert a checkpint next but this does not seem to affect either if removed
4. Now this line has the paragraph style after the InsertText not the font style.
So a minimal scenario to repeat:
RichViewEditClean.SetSelectionBounds(rsiNo, rsiOffs, ereiNo, ereiOffs); //Make sure it is at the start of a paragraph.
RichViewEditClean.InsertText(' ', True);
//Now the rest of that line changes to Paragraph style.
How can I make it so that Font style is used instead of Paragraph Style in InsertText