Exemplo n.º 1
0
        /// <summary>
        /// Called on key in interactive.
        /// </summary>
        protected override bool KeyPressed(KeyInfo key)
        {
            if (key == null)
            {
                return(false);
            }

            // drop pipeline now, if any
            PowerShell = null;

            // current line
            var currentLine = Editor.Line;

            switch (key.VirtualKeyCode)
            {
            case KeyCode.Tab:
            {
                if (key.Is())
                {
                    if (CommandArea() != null && EditorKit.NeedsTabExpansion(Editor))
                    {
                        InitTabExpansion();
                        EditorKit.ExpandCode(currentLine, Runspace);
                        Editor.Redraw();
                        return(true);
                    }
                }
                break;
            }

            case KeyCode.F1:
            {
                if (key.IsShift())
                {
                    Help.ShowHelpForContext();
                    return(true);
                }
                break;
            }
            }
            return(base.KeyPressed(key));
        }
Exemplo n.º 2
0
 public void ExpandCode(ILine editLine)
 {
     EditorKit.ExpandCode(editLine, null);
 }