powershellpowergui

How to determin CaretColumn in PowerGUI Script editor?


I found the following

[Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretLine

to determine the line of the cursor in PowerGui 2.4 Script editor.

But I found nothing to get the column. Is it really missing?

And where is the best place to ask such a question?


Yes currently the property is called CaretCharacter. But why did they call it CaretCharacter and not CaretColumn?


Solution

  • Here is it :

    [Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document.CaretCharacter
    

    How can you discover by yourself ?

    $a = [Quest.PowerGUI.SDK.ScriptEditorFactory]::CurrentInstance.CurrentDocumentWindow.Document
    $a  |Get-Member
    

    gives

       TypeName: Quest.PowerGUI.SDK.Document
    
    Name             MemberType Definition                                                                          
    ----             ---------- ----------                                                                          
    Append           Method     System.Void Append(string text)                                                     
    EnsureVisible    Method     System.Void EnsureVisible(int lineNumber)                                           
    Equals           Method     bool Equals(System.Object obj)                                                      
    GetHashCode      Method     int GetHashCode()                                                                   
    GetType          Method     type GetType()                                                                      
    Insert           Method     System.Void Insert(string text, int lineNumber, int charNumber)                     
    Select           Method     System.Void Select(int startLine, int startCharacter, int endLine, int endCharacter)
    SetCaretPosition Method     System.Void SetCaretPosition(int lineNumber, int charNumber)                        
    ToString         Method     string ToString()                                                                   
    CaretCharacter   Property   System.Int32 CaretCharacter {get;set;}                                              
    CaretLine        Property   System.Int32 CaretLine {get;set;}                                                   
    IsSaved          Property   System.Boolean IsSaved {get;}                                                       
    Lines            Property   Quest.PowerGUI.SDK.LineCollection Lines {get;}                                      
    Path             Property   System.String Path {get;}                                                           
    SelectedText     Property   System.String SelectedText {get;set;}                                               
    Text             Property   System.String Text {get;set;}