Exemple #1
0
        void DoAutocomplete(AutocompleteItem item, Range fragment)
        {
            var newText = item.GetTextForReplace();
            var tb      = fragment.tb;

            if (tb.Selection.ColumnSelectionMode)
            {
                var start = tb.Selection.Start;
                var end   = tb.Selection.End;
                start.iChar        = fragment.Start.iChar;
                end.iChar          = fragment.End.iChar;
                tb.Selection.Start = start;
                tb.Selection.End   = end;
            }
            else
            {
                tb.Selection.Start = fragment.Start;
                tb.Selection.End   = fragment.End;
            }

            tb.InsertText(newText);
            tb.Focus();
        }
Exemple #2
0
 public SelectedEventArgs(AutocompleteItem item, FastColoredTextBox tb)
 {
     Item = item;
     Tb   = tb;
 }