/// <summary> /// Update the description of the current item. This is typically called from a separate thread from the main UI thread. /// </summary> internal void UpdateCurrentItemDescription() { if (textEditor.StopCompletion()) { updateDescription.Interval = updateDescriptionInterval; updateDescription.Start(); return; } string stub = ""; string item = ""; bool isInstance = false; textEditor.textEditor.Dispatcher.Invoke(new Action(delegate() { PythonCompletionData data = (completionList.SelectedItem as PythonCompletionData); if (data == null || toolTip == null) { return; } stub = data.Stub; item = data.Text; isInstance = data.IsInstance; })); // Send to the completion thread to generate the description, providing callback. completionDataProvider.GenerateDescription(stub, item, completionList_WriteDescription, isInstance); }
/// <summary> /// Move cursor to the end of the line before retrieving the line. /// </summary> void OnEnterKeyPressed() { textEditor.StopCompletion(); if (textEditor.WriteInProgress) { return; } lock (previousLines) { // Move cursor to the end of the line. textEditor.Column = GetLastTextEditorLine().Length + 1; // Append line. string currentLine = GetCurrentLine(); previousLines.Add(currentLine); commandLineHistory.Add(currentLine); lineReceivedEvent.Set(); } }