Beispiel #1
0
        private void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = scintillaControl.CurrentPosition;
            var wordStartPos = scintillaControl.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!scintillaControl.AutoCActive)
                {
                    scintillaControl.AutoCShow(lenEntered, Autocompletelist);
                }
            }
        }
        private static void ScintillaNet_CharAdded(object sender, CharAddedEventArgs e)
        {
            DocumentView documentView = ((MainWindow)App.Current.MainWindow).ActiveDocument;

            if (documentView == null)
            {
                return;
            }

            if (e.Char == 19)
            {
                documentView.Save();
                return;
            }
            InsertMatchedChars(e);
            CSharp.Compile();
        }
Beispiel #3
0
        private void CodeEditOnCharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = codeEdit.CurrentPosition;
            var wordStartPos = codeEdit.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!codeEdit.AutoCActive)
                {
                    codeEdit.AutoCShow(lenEntered, KEYWORDS);
                }
            }
        }
Beispiel #4
0
        private void sqlEditor_CharAdded(object sender, CharAddedEventArgs e)
        {
            if (!S.Get("Autocomplete", true))
            {
                return;
            }

            bool hide = true;

            if (e.Char == '(' && S.Get("AutocompleteParenthesis", false))
            {
                editor.InsertText(editor.CurrentPosition, ")");
            }
            else if (e.Char == '\'' && S.Get("AutocompleteQuotes", true))
            {
                editor.InsertText(editor.CurrentPosition, "\'");
            }
            else if (e.Char == ',')
            {
                int pos = editor.CurrentPosition;
                if (pos > 2)
                {
                    if (editor.Text[pos - 2] == ' ' && editor.Text[pos - 3] != ' ')
                    {
                        editor.DeleteRange(pos - 2, 1);
                        // while (editor.Text.Length > pos + 2 && editor.Text[pos + 1] == ' ' && editor.Text[pos + 2] == ' ')
                        //    editor.DeleteRange(pos + 1, 1);
                        if (editor.Text.Length > pos + 1 && editor.Text[pos + 1] != ' ')
                        {
                            editor.InsertText(pos - 1, " ");
                        }
                    }
                }
            }
            else
            {
                if (OnTextChanged(true))
                {
                    hide = false;
                }
            }
            if (hide)
            {
                autoComplete.Hide();
            }
        }
Beispiel #5
0
 private static void Scintilla_CharAdded(object sender, CharAddedEventArgs e)
 {
     if (sender is Scintilla)
     {
         var scintilla = (Scintilla)sender;
         if (e.Char == '\n')
         {
             var currentPos = scintilla.CurrentPosition;
             if (scintilla.CurrentLine > 0)
             {
                 scintilla.Lines[scintilla.CurrentLine].Indentation = scintilla.Lines[scintilla.CurrentLine - 1].Indentation;
                 scintilla.CurrentPosition += scintilla.Lines[scintilla.CurrentLine].Indentation;
                 scintilla.SelectionStart   = scintilla.CurrentPosition;
             }
         }
     }
 }
Beispiel #6
0
        private void TbCode_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = tbCode.CurrentPosition;
            var wordStartPos = tbCode.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!tbCode.AutoCActive)
                {
                    tbCode.AutoCShow(lenEntered, "abstract as base break case catch checked continue default delegate Device do ECU else event explicit extern false finally fixed for foreach goto if implicit in interface internal is lock namespace new null object operator out override Parameter params private protected public readonly ref return sealed sizeof stackalloc switch this throw true try typeof unchecked unsafe using virtual while");
                }
            }
        }
Beispiel #7
0
        private void Input_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = Input.CurrentPosition;
            var wordStartPos = Input.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!Input.AutoCActive)
                {
                    Input.AutoCShow(lenEntered, "main node var obj if while for foreach");
                }
            }
        }
Beispiel #8
0
        private void Scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            var currentLineIndex = Scintilla.LineFromPosition(Scintilla.CurrentPosition);
            var currentLine      = Scintilla.Lines[currentLineIndex];

            switch (e.Char)
            {
            case '.':
            {
                var list = new List <string> {
                    "out", "in", "println", "currentTimeMillis"
                };
                list.Sort();
                Scintilla.AutoCShow(
                    Scintilla.CurrentPosition - Scintilla.WordStartPosition(Scintilla.CurrentPosition, true),
                    string.Join(" ", list));
                break;
            }

            case '}':
                if (Scintilla.Lines[currentLineIndex].Text.Trim() == "}")
                {
                    currentLine.Indentation -= Scintilla.TabWidth;
                }

                break;

            case '\n':
                var openingBraceLine = Scintilla.Lines[currentLineIndex - 2];
                var prevLine         = Scintilla.Lines[currentLineIndex - 1];

                if (Regex.IsMatch(openingBraceLine.Text, "{\\s*$"))
                {
                    Scintilla.InsertText(prevLine.EndPosition, "\n");
                    currentLine.Indentation = prevLine.Indentation + Scintilla.TabWidth;
                    Scintilla.GotoPosition(currentLine.Position + currentLine.Indentation);
                }

                break;

            default:
                InsertMatchedChars(e);
                break;
            }
        }
Beispiel #9
0
        private void Scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            int curLine = luaEditor.LineFromPosition(luaEditor.CurrentPosition);

            if (curLine < 2)
            {
                return;
            }

            string ct = luaEditor.Lines[curLine].Text.Trim().ToLower();

            if (ct == "}" ||
                ct == "else" ||
                ct == "end")
            { //Check whether the bracket is the only thing on the line.. For cases like "if() { }".
                SetIndent(luaEditor, curLine, GetIndent(luaEditor, curLine - 1) - 4);
            }
        }
Beispiel #10
0
        static void editor_CharAdded(object sender, CharAddedEventArgs e)
        {
            ScintillaNET.Scintilla editor = sender as ScintillaNET.Scintilla;
            int    pos  = editor.NativeInterface.GetCurrentPos();
            string word = editor.GetWordFromPosition(pos);

            if (e.Ch == '.')
            {
                word = editor.GetWordFromPosition(pos - 1);

                //
                // This is a quick and dirty way to populate an autocomplete list.  For a more through implementation you would want to
                // support caching of this information.  This will eliminate the reflection hit each time.
                //
                Type foundType = (from a in AppDomain.CurrentDomain.GetAssemblies()
                                  from type in GetTypes(a)
                                  where type != null && type.Name.ToLower() == word.ToLower()
                                  select type).FirstOrDefault();

                if (foundType != null)
                {
                    List <string> acList = (from m in foundType.GetMembers()
                                            where !m.Name.Contains("ctor")
                                            orderby m.Name ascending
                                            select m.Name).ToList();

                    if (acList.Count > 0)
                    {
                        Timer t = new Timer();
                        t.Interval = 10;
                        t.Tag      = editor;
                        t.Tick    += new EventHandler((obj, ev) =>
                        {
                            editor.AutoComplete.Show(acList);

                            t.Stop();
                            t.Enabled = false;
                            t.Dispose();
                        });
                        t.Start();
                    }
                }
            }
        }
Beispiel #11
0
        private void CharAdded(object sender, CharAddedEventArgs e)
        {
            char pair = '\0';

            switch (e.Char)
            {
            case '{': pair = '}'; break;

            case '(': pair = ')'; break;

            case '[': pair = ']'; break;
            }

            if (pair != '\0')
            {
                return;
            }
            TryAutoComplete();
        }
Beispiel #12
0
        private void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = scintilla.CurrentPosition;
            var wordStartPos = scintilla.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                string autoComplete = keywords + " " + _tables;

                if (!scintilla.AutoCActive)
                {
                    scintilla.AutoCShow(lenEntered, autoComplete);
                }
            }
        }
Beispiel #13
0
        // Auto complete menu
        private void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = scintilla.CurrentPosition;
            var wordStartPos = scintilla.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!scintilla.AutoCActive)
                {
                    // Possible keywords
                    // (When the lexer is available, a more complex autocomplete menu will be possible.
                    scintilla.AutoCShow(lenEntered, "Link Game Screen if import for while true false else null this ffc item global switch case default break continue bool byte char const decimal double enum float int long short static string struct void script");
                }
            }
        }
Beispiel #14
0
        private void Scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            int curLine = luaEditor.CurrentLine;

            if (curLine < 2)
            {
                return;
            }

            string text = Scintilla_TrimText(luaEditor.Lines[curLine].Text);

            if (text == "}" ||
                text.StartsWith("until") ||
                text == "else" ||
                text == "end")
            {
                var indent = luaEditor.Lines[curLine - 1].Indentation - 4;
                luaEditor.Lines[curLine].Indentation = Math.Max(0, indent);
            }
        }
Beispiel #15
0
        private void CharAdded(object sender, CharAddedEventArgs e)
        {
            char pair = '\0';

            switch (e.Char)
            {
            case '{': pair = '}'; break;

            case '(': pair = ')'; break;

            case '[': pair = ']'; break;
            }

            if (pair != '\0')
            {
                this.scintilla1.InsertText(this.scintilla1.CurrentPosition, new string(pair, 1));
                return;
            }
            TryAutoComplete();
        }
        protected override void OnCharAdded(CharAddedEventArgs e)
        {
            base.OnCharAdded(e);

            // Find the word start
            var currentPos   = this.CurrentPosition;
            var wordStartPos = this.WordStartPosition(currentPos, true);

            var lenEntered = currentPos - wordStartPos;

            if (lenEntered <= 0)
            {
                return;
            }

            // Display the autocompletion list
            var keywords = string.Join(" ", LexerService.Instance.AutoCompletionKeywords);

            this.AutoCShow(lenEntered, keywords);
        }
        protected override void OnCharAdded(CharAddedEventArgs e)
        {
            base.OnCharAdded(e);

            if (!Settings.Default.AutocompleteEnabled)
            {
                return;
            }

            var currentPos   = CurrentPosition;
            var wordStartPos = WordStartPosition(currentPos, true);

            var lenEntered = currentPos - wordStartPos;

            if (lenEntered <= 0 && e.Char != '.')
            {
                return;
            }

            this.DisplayAutocomplete(currentPos, lenEntered);
        }
        static private void editor_CharAdded1(object sender, CharAddedEventArgs e)
        {
            Scintilla editor = (Scintilla)sender;

            // Find the word start
            var currentPos   = editor.CurrentPosition;
            var wordStartPos = editor.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!editor.AutoCActive)
                {
                    editor.AutoCShow(lenEntered,
                                     String.Join(" ", MatlabKeyWords));
                }
                // "abstract as base break case catch checked continue default delegate do else event explicit extern false finally fixed for foreach goto if implicit in interface internal is lock namespace new null object operator out override params private protected public readonly ref return sealed sizeof stackalloc switch this throw true try typeof unchecked unsafe using virtual while");
            }
        }
Beispiel #19
0
        public void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos2  = t.CurrentPosition;
            var wordStartPos = t.WordStartPosition(currentPos2, true);

            // Display the autocompletion list
            var lenEntered = currentPos2 - wordStartPos;

            if (lenEntered > 0)
            {
                if (true || !t.AutoCActive)
                {
                    //"char double float int long static struct void unsigned"
                    string autokeywords = "abstract as base break case catch char checked continue default delegate do double else event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw true try typeof unchecked unsafe unsigned using virtual void while";
                    t.AutoCShow(lenEntered, autokeywords);
                }
            }
            if (e.Char == '}')
            {
                var currentPos = t.CurrentPosition;
                t.SearchFlags = SearchFlags.None;

                // Search back from the current position
                t.TargetStart = currentPos;
                t.TargetEnd   = 0;

                // Is the bracket following 4 spaces or a tab?
                if (t.SearchInTarget("    }") == (currentPos - 5))
                {
                    // Delete the leading 4 spaces
                    t.DeleteRange((currentPos - 5), 4);
                }
                else if (t.SearchInTarget("\t}") == (currentPos - 2))
                {
                    // Delete the leading tab
                    t.DeleteRange((currentPos - 2), 1);
                }
            }
        }
Beispiel #20
0
        private void OnCharAdded(object sender, CharAddedEventArgs e)
        {
            if (e.Char == 10) //created new line
            {
                string previousLine = TextArea.Lines[TextArea.CurrentLine - 1].Text;
                float  tabCount     = 0;
                foreach (var character in previousLine)
                {
                    if (character == ' ')
                    {
                        tabCount += 0.25f; //a tab is four spaces
                    }
                    else if (character == '\t')
                    {
                        tabCount++;
                    }
                    else
                    {
                        break;
                    }
                }
                TextArea.AddText(RepeatCharacter('\t', (int)tabCount));
            }

            // Find the word start
            var currentPos   = TextArea.CurrentPosition;
            var wordStartPos = TextArea.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!TextArea.AutoCActive)
                {
                    TextArea.AutoCShow(lenEntered, "abstract as base break case catch checked continue default delegate do else event explicit extern false finally fixed for foreach goto if implicit in interface internal is lock namespace new null object operator out override params private protected public readonly ref return sealed sizeof stackalloc switch this throw true try typeof unchecked unsafe using virtual while");
                }
            }
        }
Beispiel #21
0
        private void ScintillaComponent_CharAdded(object sender, CharAddedEventArgs e)
        {
            var currentPos   = this.ScintillaComponent.CurrentPosition;
            var wordStartPos = this.ScintillaComponent.WordStartPosition(currentPos, true);

            List <string> readInstructionsList = new List <string>();
            var           readInstructions     = this.ScintillaComponent.Text.Split('r');

            foreach (var r in readInstructions)
            {
                int rThread = -1;
                if (!string.IsNullOrEmpty(r) && int.TryParse(r.Split('(')[0], out rThread) && !readInstructionsList.Contains('r' + rThread.ToString()))
                {
                    readInstructionsList.Add('r' + rThread.ToString());
                }
            }

            List <string> writeInstructionsList = new List <string>();
            var           writeInstructions     = this.ScintillaComponent.Text.Split('w');

            foreach (var w in writeInstructions)
            {
                int wThread = -1;
                if (!string.IsNullOrEmpty(w) && int.TryParse(w.Split('(')[0], out wThread) && !writeInstructionsList.Contains('w' + wThread.ToString()))
                {
                    writeInstructionsList.Add('w' + wThread.ToString());
                }
            }

            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!this.ScintillaComponent.AutoCActive)
                {
                    this.ScintillaComponent.AutoCShow(lenEntered, string.Join(" ", readInstructionsList.Concat(writeInstructionsList).ToArray()));
                }
            }
        }
Beispiel #22
0
        private void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = scintillaControl.CurrentPosition;
            var wordStartPos = scintillaControl.WordStartPosition(currentPos, true);

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!scintillaControl.AutoCActive)
                {
                    scintillaControl.AutoCShow(lenEntered, autocompletelist);
                }
            }

            // notify unsaved
            IsUnsafed = true;
            this.Text = $"{Path.GetFileName(FilePath)}*";
            UIController.Get().Window.AddToOpenScripts(this);
        }
Beispiel #23
0
        private void AutoIndent(object sender, CharAddedEventArgs e)
        {
            Line currentLine = Lines[CurrentLine];
            int  currentPos  = CurrentPosition;

            if (e.Char == '\r')
            {
                Line previousLine = Lines[CurrentLine - 1];

                if (previousLine.Text.Trim().EndsWith(":"))
                {
                    currentLine.Indentation = previousLine.Indentation + IndentWidth;
                    CurrentPosition         = currentPos + currentLine.Indentation;
                    SelectionStart          = CurrentPosition;
                }
                else
                {
                    currentLine.Indentation = previousLine.Indentation;
                    CurrentPosition         = currentPos + currentLine.Indentation;
                    SelectionStart          = CurrentPosition;
                }
            }
        }
Beispiel #24
0
        private void ExScintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            var currentPos   = this.CurrentPosition;
            var wordStartPos = this.WordStartPosition(currentPos, true);

            char c = this.Text[this.CurrentPosition - 1];
            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (e.Char == ' ' && this.FCompletionForm != null)
            {
                this.HideCompletions();
            }
            else if (e.Char == '(')
            {
                Application.DoEvents();
                this.FindCompletions();

                if (this.Completions.Count == 1)
                {
                    Completion comp = this.Completions[0];
                }
            }
            else if (e.Char == '.')
            {
                Application.DoEvents();
                this.FindCompletions();
            }
            else if (this.FCompletionForm == null && lenEntered == 1)
            {
                this.FindCompletions();
            }
            else if (this.FCompletionForm != null)
            {
                this.SetFilter(0);
            }
        }
Beispiel #25
0
        private void scintilla_CharAdded(object sender, CharAddedEventArgs e)
        {
            // Find the word start
            var currentPos   = scintilla.CurrentPosition;
            var wordStartPos = scintilla.WordStartPosition(currentPos, true);

            if (e.Char == '\n')
            {
                if (scintilla.Lines.Count > 1)
                {
                    Line   lastLine   = scintilla.Lines[scintilla.CurrentLine - 1];
                    string lastIndent = lastLine.Text.Substring(0, lastLine.Indentation);
                    scintilla.AddText(lastIndent);
                }
            }

            // Display the autocompletion list
            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                scintilla.AutoCShow(lenEntered, Target.NameExpressions);
            }
        }
Beispiel #26
0
 void RubyScintilla_CharAdded(object sender, CharAddedEventArgs e)
 {
     if (e.Ch == '\n')
     {
         string lastline = this.Lines.Current.Previous.Text.Trim();
         if (lastline == "=begin" || lastline == "=end")
         {
             this.Lines.Current.Previous.Indentation = 0;
         }
         else
         {
             int num = this.GetLineIndent(Lines.Current.Previous);
             if (num != -1)
             {
                 Lines.Current.Previous.Indentation = num * Indentation.TabWidth;
             }
         }
         int lineIndent = this.GetLineIndent(Lines.Current);
         if (lineIndent != -1)
         {
             this.InsertText(new string(' ', lineIndent * Indentation.TabWidth));
         }
     }
 }
Beispiel #27
0
        protected override void OnCharAdded(CharAddedEventArgs e)
        {
            base.OnCharAdded(e);

            // Find the word start
            var currentPos   = this.CurrentPosition;
            var wordStartPos = this.WordStartPosition(currentPos, true);

            var lenEntered = currentPos - wordStartPos;

            if (lenEntered <= 0 && e.Char != '.')
            {
                return;
            }

            var currentWord = this.GetWordFromPosition(wordStartPos) ?? "";


            // Display the autocompletion list
            var keywords = string.Join(" ", LexerService.GetAutoCompletionKeywords(currentPos).
                                       Where(x => x.StartsWith(currentWord, StringComparison.OrdinalIgnoreCase)).OrderBy(x => x));

            this.AutoCShow(lenEntered, keywords);
        }
Beispiel #28
0
 private void ZeusScintillaControl_CharAdded(object sender, CharAddedEventArgs e)
 {
     this.Cursor_ = (int)Scintilla.Enums.CursorShape.Wait;
     AutoCompleteHelper.CharAdded(this, e.Ch);
     this.Cursor_ = (int)Scintilla.Enums.CursorShape.Normal;
 }
Beispiel #29
0
        private void ScintillaNet_CharAdded(object sender, CharAddedEventArgs e)
        {
            ScriptHelpMgr.Instance.bCompileError = true;
            bNeedSaved = true;
            int nPos = TextArea.CurrentPosition;

            //AXIS
            if (e.Char == '.')
            {
                string sWord = TextArea.GetWordFromPosition(nPos - 1);
                if (sWord.Contains("AXIS"))
                {
                    TextArea.AutoCShow(0, sbAxisStructPromt.ToString());
                }
                else if (sWord.Contains("INST"))
                {
                    TextArea.AutoCShow(0, sbInstrumentStructPromt.ToString());
                }
                else if (sWord.Contains("ENUM"))
                {
                    TextArea.AutoCShow(0, sbEnumPromt1.ToString());
                }
                else if (sbEnumPromt1.ToString().Contains(sWord) && sbEnumPromt2Dic.Keys.Contains(sWord))
                {
                    TextArea.AutoCShow(0, sbEnumPromt2Dic[sWord].ToString());
                }
                else
                {
                    foreach (var it in rawDataDic)
                    {
                        if (it.Key == sWord)
                        {
                            TextArea.AutoCShow(0, strCateDic[sWord]);   //strCateDic : Cate-----"func1 func2 func3"
                            break;
                        }
                    }
                }
            }
            else if (e.Char == '(')
            {
                string sWord = TextArea.GetWordFromPosition(nPos - 1);
                foreach (var it in Funcmanager.Funcs)
                {
                    if (it.FunctionName == sWord)
                    {
                        strPromot = it.Prompt;
                        TextArea.CallTipShow(nPos, strPromot);
                        break;
                    }
                }
                nStartPos = strPromot.IndexOf('(');
                nEndPos   = strPromot.IndexOf(',') == -1 ? strPromot.IndexOf(')') : strPromot.IndexOf(',');
                TextArea.CallTipSetHlt(nStartPos, nEndPos);
            }
            else if (e.Char == ')')
            {
                TextArea.CallTipCancel();
                strPromot = "";
                nEndPos   = 0;
            }
            else if (e.Char == ',')
            {
                int pos1 = nEndPos;
                if (pos1 < strPromot.Length)
                {
                    int pos2 = strPromot.IndexOf(',', pos1 + 1) == -1 ? strPromot.IndexOf(')') : strPromot.IndexOf(',', pos1 + 1);
                    TextArea.CallTipShow(nPos, strPromot);
                    TextArea.CallTipSetHlt(pos1, pos2);
                    nEndPos = pos2;
                }
            }
        }
Beispiel #30
0
        protected override void OnCharAdded(CharAddedEventArgs e)
        {
            base.OnCharAdded(e);

            switch (e.Char)
            {
            case 13:
                string prevLine = Lines[CurrentLine - 1].Text.Replace("\t", new string(' ', 4)).TrimEnd();

                if (prevLine.Length == 0)
                {
                    prevLine = Lines[CurrentLine - 1].Text.Replace("\t", new string(' ', 4));
                }

                int indent = (prevLine.Length - prevLine.TrimStart().Length) / 4;
                AddText(new string('\t', indent));

                if (prevLine.EndsWith("{"))
                {
                    AddText(new string('\t', 1));
                }
                break;

            case '.':
                string[] members = Program.Parser.GetMembers(CurrentPosition - 1);

                if (members.Length > 0)
                {
                    string list = " ";

                    foreach (string member in members)
                    {
                        if (list.IndexOf(" " + member + " ") == -1)
                        {
                            list += member + " ";
                        }
                    }

                    AutoCShow(0, list.Trim());
                }
                break;

            case '(':
                string word = GetWordFromPosition(CurrentPosition - 1);
                string pre  = GetWordFromPosition(CurrentPosition - 1 - word.Length - 1);

                switch (pre)
                {
                case "new":
                    break;
                }
                break;

            case '}':
                string currLine      = Lines[CurrentLine].Text.Replace("\t", new string(' ', 4)).TrimEnd();
                string foldParent    = Lines[Lines[CurrentLine].FoldParent].Text.Replace("\t", new string(' ', 4)).TrimEnd();
                int    indentParent  = (foldParent.Length - foldParent.TrimStart().Length) / 4;
                int    indentCurrent = (currLine.Length - currLine.TrimStart().Length) / 4;

                if (indentParent != indentCurrent)
                {
                    DeleteRange(Lines[CurrentLine].Position, (GetTextRange(CurrentPosition - 2, 1) == "\t" ? 1 : 4) * (indentCurrent - indentParent));
                }
                break;

            default:
                int    pos = CurrentPosition;
                string wrd = GetWordFromPosition(pos).ToLower();
                string lst = " ";

                foreach (string keyword in _keywordList.Split(new char[] { ' ' }))
                {
                    if (keyword.ToLower().Contains(wrd))
                    {
                        if (lst.IndexOf(" " + keyword + " ") >= 0)
                        {
                            continue;
                        }
                        lst += keyword + " ";
                    }
                }

                if (char.IsLetter((char)e.Char))
                {
                    foreach (string name in Program.Parser.GetTypes())
                    {
                        if (lst.IndexOf(name + " ") == -1)
                        {
                            lst += name + " ";
                        }
                    }

                    foreach (string name in Program.Parser.GetMembers(CurrentPosition))
                    {
                        if (lst.IndexOf(name + " ") == -1)
                        {
                            lst += name + " ";
                        }
                    }

                    foreach (Type type in typeof(Api.Sketch).Assembly.GetTypes())
                    {
                        string name = type.Name;

                        if (type.IsPublic && name.ToLower().Contains(wrd) && lst.IndexOf(" " + name + " ") == -1)
                        {
                            lst += name + " ";
                        }

                        foreach (MemberInfo member in type.GetMembers())
                        {
                            name = member.Name;

                            if (!name.ToLower().Contains(wrd))
                            {
                                continue;
                            }

                            if (member is FieldInfo && ((FieldInfo)member).IsSpecialName)
                            {
                                continue;
                            }

                            if (member is ConstructorInfo)
                            {
                                continue;
                            }

                            if (member is MethodInfo)
                            {
                                if (((MethodInfo)member).IsSpecialName /*|| ((MethodInfo)member).IsHideBySig*/)
                                {
                                    name = "";
                                }
                            }

                            if (name.Length == 0)
                            {
                                continue;
                            }

                            if (lst.IndexOf(" " + name + " ") == -1)
                            {
                                lst += name + " ";
                            }

                            if (lst.Contains("noiseDetail"))
                            {
                                lst.ToString();
                            }
                        }
                    }

                    if (lst.Length > 1)
                    {
                        lst = lst.Substring(1, lst.Length - 2);
                    }

                    AutoCShow(wrd.Length, lst);
                    //CallTipShow(pos, "This is something\r\nThat can be *used*");
                }
                break;
            }

            UpdateLineMargin();
        }