Getting the End Document Display Character Position

SyntaxEditor for WPF Forum

Posted 8 years ago by Erwin Liong
Version: 15.1.0624

Hi ActiPro,


Is there a way to get the display character column position for the document's end position? My last line contains '\t' characters. I would like to get something similar as ICaret's Display Line and Display Character Column where Tab size are accounted for.


I am currently using this:

documentEndPosition.Line = editor.ActiveView.CurrentSnapshot.SnapshotRange.EndPosition.Line + 1;

documentEndPosition.Column = editor.ActiveView.CurrentSnapshot.SnapshotRange.EndPosition.Character + 1;

The column position treats '\t' as 1 character instead of number of characters defined by Tab Size.


Thanks in advance for the help.

Comments (1)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Erwin,

You can do this sort of thing:

var displayColumn = editor.ActiveView.GetCharacterColumn(editor.ActiveView.CurrentSnapshot.SnapshotRange.EndPosition) + 1;

Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.