471,305 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,305 software developers and data experts.

Extensibility bug??

I think I have found a bug in the VS text editor but would like someone
to confirm or deny it.

Consider the following sub:

Private Sub TestMe()
'lllllllLLLLLLL
End Sub

The comment line has a number of lower case L's followed by some upper
case L's. When I use a FIXED width font, the Ln, Col, and Ch
indicators at the bottom of the code windows indicate the correct
results. If I switch to a PROPORTIONAL font, the values are not
correct.

I discovered this when using this macro to try to get the current line
and column number, but the values returned were incorrect.

Sub TestMe()
Dim sel As TextSelection = DTE.ActiveDocument.Selection
Dim iLine As Integer = sel.CurrentLine
Dim iCol As Integer = sel.CurrentColumn
MsgBox("Line: " & iLine.ToString & ", Column: " & iCol.ToString)
End Sub

As I moved the caret to different postions in the line, the values
returned were wrong.

Can anyone confirm or deny this? Am I missing something? If this is
by design, how can I find the current line number and column number
accurately if the user is using a proportional font?

Thanks,

Chris

Jul 21 '05 #1
0 873

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by relaxedrob | last post: by
reply views Thread by Jason | last post: by
4 posts views Thread by Richard | last post: by
1 post views Thread by Sachin | last post: by
1 post views Thread by frenchyyy | last post: by
1 post views Thread by Brian Keating | last post: by
reply views Thread by Bill Barker | last post: by
9 posts views Thread by Francis Johnson | last post: by
reply views Thread by Eric Davies | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.