private bool ReplaceIfNeeded(TextArea area, SnippetInfo snippInfo)
 {
     var i = area.Caret.Offset;
     var shortcuts = snippInfo.Header.Shortcuts;
     var num = -1;
     var document = area.Document;
     if (i <= 0)
     {
         return false;
     }
     while (i > 0)
     {
         if (i >= document.TextLength)
         {
             i--;
         }
         var charAt = document.GetCharAt(i);
         if (IsWhitespace(charAt))
         {
             num = i + 1;
             break;
         }
         i--;
         num = i;
     }
     if (num < area.Caret.Offset)
     {
         num = Math.Max(num, 0);
         var length = area.Caret.Offset - num;
         var text = document.GetText(num, length);
         if (shortcuts.Any((string shortcut) => shortcut.Contains(text)))
         {
             document.Replace(num, length, string.Empty);
             return true;
         }
     }
     return false;
 }
 public SnippetToolTip(SnippetInfo snippetInfo)
 {
     InitializeComponent();
     DataContext = this;
 }
 public SnippetCompletionData(SnippetInfo snippetInfo)
 {
     this.snippetInfo = snippetInfo;
 }