public RHistory(IRInteractiveWorkflowVisual interactiveWorkflow, ITextBuffer textBuffer, IFileSystem fileSystem, IRSettings settings, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, Action dispose) { _interactiveWorkflow = interactiveWorkflow; _historyTextBuffer = textBuffer; _fileSystem = fileSystem; _editorOperationsFactory = editorOperationsFactory; _rtfBuilderService = rtfBuilderService; _dispose = dispose; _textBufferIsEditable = new CountdownDisposable(MakeTextBufferReadOnly); _isMultiline = settings.MultilineHistorySelection; if (_isMultiline) { _entries = new MultilineRHistoryEntries(); } else { _entries = new SinglelineRHistoryEntries(); } _nextEntrySelector = new SingleEntrySelector(this, false); _previousEntrySelector = new SingleEntrySelector(this, true); _rangeUpEntrySelector = new RangeEntrySelector(this, true); _rangeDownEntrySelector = new RangeEntrySelector(this, false); MakeTextBufferReadOnly(); }
public SinglelineRHistoryEntries(IRHistoryEntries entries) { if (entries.IsMultiline) { CloneFromMultiline(entries); } else { CloneEntries(entries); } }
private void CloneFromMultiline(IRHistoryEntries existingEntries) { foreach (var existingEntry in existingEntries.GetEntries()) { var entriesGroup = AddSinglelineEntries(existingEntry.EntrySpan); foreach (var newEntry in entriesGroup) { newEntry.IsSelected = existingEntry.IsSelected; } } }
protected void CloneEntries(IRHistoryEntries existingEntries) { foreach (var existingEntry in existingEntries.GetEntries()) { var newEntry = AddEntry(existingEntry.EntrySpan, existingEntry.Span); newEntry.IsSelected = existingEntry.IsSelected; } }
private void CloneFromSingleline(IRHistoryEntries existingEntries) { foreach (var entrySpanGroup in existingEntries.GetEntries().GroupBy(e => e.EntrySpan)) { var newEntry = AddMultilineEntry(entrySpanGroup.Key); newEntry.IsSelected = entrySpanGroup.Any(e => e.IsSelected); } }
public RHistory(IRInteractiveWorkflow interactiveWorkflow, ITextBuffer textBuffer, IFileSystem fileSystem, IRSettings settings, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, Action dispose) { _interactiveWorkflow = interactiveWorkflow; _historyTextBuffer = textBuffer; _fileSystem = fileSystem; _editorOperationsFactory = editorOperationsFactory; _rtfBuilderService = rtfBuilderService; _dispose = dispose; _textBufferIsEditable = new CountdownDisposable(MakeTextBufferReadOnly); _isMultiline = settings.MultilineHistorySelection; if (_isMultiline) { _entries = new MultilineRHistoryEntries(); } else { _entries = new SinglelineRHistoryEntries(); } MakeTextBufferReadOnly(); }