Пример #1
0
 //Autocomplete trigger
 private void editor_CharAdded(object sender, CharAddedEventArgs e)
 {
     if (e.Char == '(')
     {
         if (!editor.AutoCActive)
         {
             editor.AutoCShow(0, ShiroLexer.GetAutoCompleteItems());
         }
     }
 }
Пример #2
0
        private void showAutocompleteMenu_Click(object sender, EventArgs e)
        {
            if (editor.AutoCActive)
            {
                return;
            }

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

            var lenEntered = currentPos - wordStartPos;

            if (lenEntered > 0)
            {
                if (!editor.AutoCActive)
                {
                    editor.AutoCShow(lenEntered, ShiroLexer.GetAutoCompleteItems());
                }
            }
        }