I used the function int PositionToOffset(TextPosition position) from ITextSnapshot interface to convert text position to offset.
int i = 0; int k = 5;
My text editor has above text. The cursor position is infront of character 'i' in first line. (Text position line=0, column=8).
PositionToOffset return the value 8 as offset. (Consider tab character as 4 characters/offsets)
But when I'm getting it from editor caret position, offset is 5. (path => SyntaxEditor.Caret.Offset. It is giving Offset as 5.) (Consider tab character as 1 character/offset)
This is inconsistent. Please fix this issue.
Is there anyway to get the offset from TextPosition, with consider tab character as 1 offset?