Environmental.NewLine and TextRanges
In my project i have a class that uses System.String and StringBuilder for document creation. This class also keeps a small list of indexes to identify location of certain tokens.The indexes are calculated using string.IndexOf
What I've noticed is that in ActiPro document, a new Line uses 1 char position
instead of 2 chars (\n\r) which a string with Environmental.NewLine uses.
When I try to locate the caret offset using my original TextRanges,
then it places the caret in a different position than expected.
Note: My workaround was to adapt my classes to start counting how many NewLines
and have a separate TextRange where the newlines are substracted.
I would like to remove this extra calculation in the future , therefore the question.
Is there any way to configure the editor/document to "use" 2 chars so i can use the "same" TextRanges?
In my project i have a class that uses System.String and StringBuilder for document creation. This class also keeps a small list of indexes to identify location of certain tokens.The indexes are calculated using string.IndexOf
What I've noticed is that in ActiPro document, a new Line uses 1 char position
instead of 2 chars (\n\r) which a string with Environmental.NewLine uses.
When I try to locate the caret offset using my original TextRanges,
then it places the caret in a different position than expected.
Note: My workaround was to adapt my classes to start counting how many NewLines
and have a separate TextRange where the newlines are substracted.
I would like to remove this extra calculation in the future , therefore the question.
Is there any way to configure the editor/document to "use" 2 chars so i can use the "same" TextRanges?