Getting the End Document Display Character Position

SyntaxEditor for WPF Forum

Posted 4 years ago by Erwin Liong
Version: 15.1.0624
Avatar

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 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 (v2019.1 build 0684) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.