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