internal CommandMarginController( IVimBuffer buffer, FrameworkElement parentVisualElement, CommandMarginControl control, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap, ICommonOperations commonOperations, IClipboardDevice clipboardDevice, bool isFirstCommandMargin) { _vimBuffer = buffer; _margin = control; _parentVisualElement = parentVisualElement; _editorFormatMap = editorFormatMap; _classificationFormatMap = classificationFormatMap; _commonOperations = commonOperations; _clipboardDevice = clipboardDevice; _isFirstCommandMargin = isFirstCommandMargin; InitializeMargin(); Connect(); UpdateForRecordingChanged(); UpdateTextColor(); UpdateStatusLineVisibility(); UpdateLastMessage(); }
protected VimTestBase() { _vim = CompositionContainer.GetExportedValue <IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue <IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue <IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue <IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue <IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue <IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue <IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue <IClipboardDevice>(); _keyUtil = CompositionContainer.GetExportedValue <IKeyUtil>(); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interferring // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; // Don't show trace information in the unit tests. It really clutters the output in an // xUnit run VimTrace.TraceSwitch.Level = TraceLevel.Off; }
protected VimTestBase() { _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>(); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interferring // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; // Don't show trace information in the unit tests. It really clutters the output in an // xUnit run VimTrace.TraceSwitch.Level = TraceLevel.Off; }
internal static RegisterMap CreateRegisterMap(IClipboardDevice device, Func <string> func) { Func <FSharpOption <string> > func2 = () => { var result = func(); return(string.IsNullOrEmpty(result) ? FSharpOption <string> .None : FSharpOption.Create(result)); }; return(new RegisterMap(new VimData(), device, func2.ToFSharpFunc())); }
internal CommandMarginProvider( IVim vim, IEditorFormatMapService editorFormatMapService, IClassificationFormatMapService classificationFormatMapService, ICommonOperationsFactory commonOperationsFactory, IClipboardDevice clipboardDevice) { _vim = vim; _editorFormatMapService = editorFormatMapService; _classificationFormatMapService = classificationFormatMapService; _commonOperationsFactory = commonOperationsFactory; _clipboardDevice = clipboardDevice; }
protected VimTestBase() { _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); }
public SettingsSync( IVimApplicationSettings vimApplicationSettings, IMarkDisplayUtil markDisplayUtil, IControlCharUtil controlCharUtil, IClipboardDevice clipboardDevice) { VimApplicationSettings = vimApplicationSettings; MarkDisplayUtil = markDisplayUtil; ControlCharUtil = controlCharUtil; ClipboardDevice = clipboardDevice; MarkDisplayUtil.HideMarksChanged += SyncToApplicationSettings; ControlCharUtil.DisplayControlCharsChanged += SyncToApplicationSettings; VimApplicationSettings.SettingsChanged += SyncFromApplicationSettings; }
internal static ICommonOperations CreateCommonOperations( ITextView textView, IVimLocalSettings localSettings, IOutliningManager outlining = null, IStatusUtil statusUtil = null, ISearchService searchService = null, IUndoRedoOperations undoRedoOperations = null, IVimData vimData = null, IVimHost vimHost = null, ITextStructureNavigator navigator = null, IClipboardDevice clipboardDevice = null, IFoldManager foldManager = null) { var editorOperations = EditorUtil.GetOperations(textView); var editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(textView); var jumpList = new JumpList(new TrackingLineColumnService()); var keyMap = new KeyMap(); foldManager = foldManager ?? new FoldManager(textView.TextBuffer); statusUtil = statusUtil ?? new StatusUtil(); searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings); undoRedoOperations = undoRedoOperations ?? new UndoRedoOperations(statusUtil, FSharpOption <ITextUndoHistory> .None, editorOperations); vimData = vimData ?? new VimData(); vimHost = vimHost ?? new MockVimHost(); navigator = navigator ?? CreateTextStructureNavigator(textView.TextBuffer); clipboardDevice = clipboardDevice ?? new MockClipboardDevice(); var operationsData = new OperationsData( editorOperations, editorOptions, foldManager, jumpList, keyMap, localSettings, outlining != null ? FSharpOption.Create(outlining) : FSharpOption <IOutliningManager> .None, CreateRegisterMap(clipboardDevice), searchService, statusUtil, textView, undoRedoOperations, vimData, vimHost, navigator); return(new CommonOperations(operationsData)); }
internal VsVimHost( IVsAdapter adapter, ITextBufferFactoryService textBufferFactoryService, ITextEditorFactoryService textEditorFactoryService, ITextDocumentFactoryService textDocumentFactoryService, ITextBufferUndoManagerProvider undoManagerProvider, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService, ISmartIndentationService smartIndentationService, ITextManager textManager, ISharedServiceFactory sharedServiceFactory, IVimApplicationSettings vimApplicationSettings, IExtensionAdapterBroker extensionAdapterBroker, IProtectedOperations protectedOperations, IMarkDisplayUtil markDisplayUtil, IControlCharUtil controlCharUtil, ICommandDispatcher commandDispatcher, SVsServiceProvider serviceProvider, IClipboardDevice clipboardDevice) : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService) { _vsAdapter = adapter; _editorAdaptersFactoryService = editorAdaptersFactoryService; _dte = (_DTE)serviceProvider.GetService(typeof(_DTE)); _vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility)); _textManager = textManager; _sharedService = sharedServiceFactory.Create(); _vsMonitorSelection = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>(); _vimApplicationSettings = vimApplicationSettings; _smartIndentationService = smartIndentationService; _extensionAdapterBroker = extensionAdapterBroker; _runningDocumentTable = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>(); _vsShell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); _protectedOperations = protectedOperations; _commandDispatcher = commandDispatcher; _clipboardDevice = clipboardDevice; _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie); _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie); InitOutputPane(); _settingsSync = new SettingsSync(vimApplicationSettings, markDisplayUtil, controlCharUtil, _clipboardDevice); _settingsSync.SyncFromApplicationSettings(); }
internal static ICommonOperations CreateCommonOperations( ITextView textView, IVimLocalSettings localSettings, IOutliningManager outlining = null, IStatusUtil statusUtil = null, ISearchService searchService = null, IUndoRedoOperations undoRedoOperations = null, IVimData vimData = null, IVimHost vimHost = null, ITextStructureNavigator navigator = null, IClipboardDevice clipboardDevice = null, IFoldManager foldManager = null) { var editorOperations = EditorUtil.GetOperations(textView); var editorOptions = EditorUtil.FactoryService.EditorOptionsFactory.GetOptions(textView); var jumpList = new JumpList(new TrackingLineColumnService()); var keyMap = new KeyMap(); foldManager = foldManager ?? new FoldManager(textView.TextBuffer); statusUtil = statusUtil ?? new StatusUtil(); searchService = searchService ?? CreateSearchService(localSettings.GlobalSettings); undoRedoOperations = undoRedoOperations ?? new UndoRedoOperations(statusUtil, FSharpOption<ITextUndoHistory>.None); vimData = vimData ?? new VimData(); vimHost = vimHost ?? new MockVimHost(); navigator = navigator ?? CreateTextStructureNavigator(textView.TextBuffer); clipboardDevice = clipboardDevice ?? new MockClipboardDevice(); var operationsData = new OperationsData( editorOperations, editorOptions, foldManager, jumpList, keyMap, localSettings, outlining != null ? FSharpOption.Create(outlining) : FSharpOption<IOutliningManager>.None, CreateRegisterMap(clipboardDevice), searchService, EditorUtil.FactoryService.SmartIndentationService, statusUtil, textView, undoRedoOperations, vimData, vimHost, navigator); return new CommonOperations(operationsData); }
public VimEditorHost(CompositionContainer compositionContainer) : base(compositionContainer) { _vim = CompositionContainer.GetExportedValue <IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue <IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue <IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue <IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue <IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue <IBulkOperations>(); _keyUtil = CompositionContainer.GetExportedValue <IKeyUtil>(); _protectedOperations = CompositionContainer.GetExportedValue <IProtectedOperations>(); _keyboardDevice = CompositionContainer.GetExportedValue <IKeyboardDevice>(); _mouseDevice = CompositionContainer.GetExportedValue <IMouseDevice>(); _clipboardDevice = CompositionContainer.GetExportedValue <IClipboardDevice>(); _editorFormatMapService = CompositionContainer.GetExportedValue <IEditorFormatMapService>(); _classificationFormatMapService = CompositionContainer.GetExportedValue <IClassificationFormatMapService>(); }
public VimEditorHost(CompositionContainer compositionContainer) : base(compositionContainer) { _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtil = CompositionContainer.GetExportedValue<IWordUtil>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>(); _vimProtectedOperations = CompositionContainer.GetExportedValue<IVimProtectedOperations>(); _keyboardDevice = CompositionContainer.GetExportedValue<IKeyboardDevice>(); _mouseDevice = CompositionContainer.GetExportedValue<IMouseDevice>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); }
public CommandMargin( FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap, ICommonOperations commonOperations, IClipboardDevice clipboardDevice, bool isFirstCommandMargin) { _controller = new CommandMarginController( buffer, parentVisualElement, _margin, editorFormatMap, classificationFormatMap, commonOperations, clipboardDevice, isFirstCommandMargin); _enabled = true; }
protected VimTestBase() { // Parts of the core editor in Vs2012 depend on there being an Application.Current value else // they will throw a NullReferenceException. Create one here to ensure the unit tests successfully // pass if (Application.Current == null) { new Application(); } _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtil = CompositionContainer.GetExportedValue<IWordUtil>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>(); _vimProtectedOperations = CompositionContainer.GetExportedValue<IVimProtectedOperations>(); _keyboardDevice = CompositionContainer.GetExportedValue<IKeyboardDevice>(); _mouseDevice = CompositionContainer.GetExportedValue<IMouseDevice>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interfering // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; // Don't show trace information in the unit tests. It really clutters the output in an // xUnit run VimTrace.TraceSwitch.Level = TraceLevel.Off; }
protected VimTestBase() { // Parts of the core editor in Vs2012 depend on there being an Application.Current value else // they will throw a NullReferenceException. Create one here to ensure the unit tests successfully // pass if (Application.Current == null) { new Application(); } _vim = CompositionContainer.GetExportedValue <IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue <IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue <IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue <ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue <IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue <IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue <IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue <IBulkOperations>(); _keyUtil = CompositionContainer.GetExportedValue <IKeyUtil>(); _vimProtectedOperations = CompositionContainer.GetExportedValue <IVimProtectedOperations>(); _keyboardDevice = CompositionContainer.GetExportedValue <IKeyboardDevice>(); _mouseDevice = CompositionContainer.GetExportedValue <IMouseDevice>(); _clipboardDevice = CompositionContainer.GetExportedValue <IClipboardDevice>(); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interfering // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; // Don't show trace information in the unit tests. It really clutters the output in an // xUnit run VimTrace.TraceSwitch.Level = TraceLevel.Off; }
public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap, ICommonOperations commonOperations, IClipboardDevice clipboardDevice) { _margin.CommandLineTextBox.Text = "Welcome to Vim"; _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, classificationFormatMap, commonOperations, clipboardDevice); _enabled = true; }
internal static RegisterMap CreateRegisterMap(IClipboardDevice device, Func<string> func) { Func<FSharpOption<string>> func2 = () => { var result = func(); return string.IsNullOrEmpty(result) ? FSharpOption<string>.None : FSharpOption.Create(result); }; return new RegisterMap(device, func2.ToFSharpFunc()); }
internal static RegisterMap CreateRegisterMap(IClipboardDevice device) { return CreateRegisterMap(device, () => null); }
public override void SetupBase() { base.SetupBase(); _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _vimErrorDetector.Clear(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interferring // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; _vim.VimData.LastShellCommand = FSharpOption<string>.None; _vim.VimData.LastCommand = FSharpOption<StoredCommand>.None; }
internal static RegisterMap CreateRegisterMap(IClipboardDevice device) { return(CreateRegisterMap(device, () => null)); }
public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap, ICommonOperations commonOperations, IClipboardDevice clipboardDevice, bool isFirstCommandMargin) { _margin.CommandLineTextBox.Text = isFirstCommandMargin ? $"Welcome to VsVim Version {VimConstants.VersionNumber}" : string.Empty; _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, classificationFormatMap, commonOperations, clipboardDevice); _enabled = true; }