Ejemplo n.º 1
0
        internal CommandMarginController(IVimBuffer buffer, FrameworkElement parentVisualElement, CommandMarginControl control, IEditorFormatMap editorFormatMap, IFontProperties fontProperties)
        {
            _vimBuffer           = buffer;
            _margin              = control;
            _parentVisualElement = parentVisualElement;
            _editorFormatMap     = editorFormatMap;
            _fontProperties      = fontProperties;

            _vimBuffer.SwitchedMode                       += OnSwitchMode;
            _vimBuffer.KeyInputStart                      += OnKeyInputStart;
            _vimBuffer.KeyInputEnd                        += OnKeyInputEnd;
            _vimBuffer.StatusMessage                      += OnStatusMessage;
            _vimBuffer.ErrorMessage                       += OnErrorMessage;
            _vimBuffer.WarningMessage                     += OnWarningMessage;
            _vimBuffer.CommandMode.CommandChanged         += OnCommandChanged;
            _vimBuffer.Vim.MacroRecorder.RecordingStarted += OnRecordingStarted;
            _vimBuffer.Vim.MacroRecorder.RecordingStopped += OnRecordingStopped;
            _margin.Loaded   += OnCommandMarginLoaded;
            _margin.Unloaded += OnCommandMarginUnloaded;
            _margin.CommandLineTextBox.PreviewKeyDown    += OnCommandLineTextBoxPreviewKeyDown;
            _margin.CommandLineTextBox.TextChanged       += OnCommandLineTextBoxTextChanged;
            _margin.CommandLineTextBox.SelectionChanged  += OnCommandLineTextBoxSelectionChanged;
            _margin.CommandLineTextBox.LostKeyboardFocus += OnCommandLineTextBoxLostKeyboardFocus;
            _margin.CommandLineTextBox.PreviewMouseDown  += OnCommandLineTextBoxPreviewMouseDown;
            _editorFormatMap.FormatMappingChanged        += OnFormatMappingChanged;
            UpdateForRecordingChanged();
            UpdateTextColor();
        }
Ejemplo n.º 2
0
        internal CommandMarginController(IVimBuffer buffer, FrameworkElement parentVisualElement, CommandMarginControl control, IEditorFormatMap editorFormatMap, IFontProperties fontProperties, IEnumerable<Lazy<IOptionsProviderFactory>> optionsProviderFactory)
        {
            _vimBuffer = buffer;
            _margin = control;
            _parentVisualElement = parentVisualElement;
            _editorFormatMap = editorFormatMap;
            _fontProperties = fontProperties;
            _optionsProviderFactory = optionsProviderFactory.ToList().AsReadOnly();

            _vimBuffer.SwitchedMode += OnSwitchMode;
            _vimBuffer.KeyInputStart += OnKeyInputStart;
            _vimBuffer.KeyInputEnd += OnKeyInputEnd;
            _vimBuffer.StatusMessage += OnStatusMessage;
            _vimBuffer.ErrorMessage += OnErrorMessage;
            _vimBuffer.WarningMessage += OnWarningMessage;
            _vimBuffer.CommandMode.CommandChanged += OnCommandChanged;
            _vimBuffer.Vim.MacroRecorder.RecordingStarted += OnRecordingStarted;
            _vimBuffer.Vim.MacroRecorder.RecordingStopped += OnRecordingStopped;
            _margin.Loaded += OnCommandMarginLoaded;
            _margin.Unloaded += OnCommandMarginUnloaded;
            _margin.OptionsButton.Click += OnOptionsClicked;
            _margin.CommandLineTextBox.PreviewKeyDown += OnCommandLineTextBoxPreviewKeyDown;
            _margin.CommandLineTextBox.TextChanged += OnCommandLineTextBoxTextChanged;
            _margin.CommandLineTextBox.SelectionChanged += OnCommandLineTextBoxSelectionChanged;
            _margin.CommandLineTextBox.LostKeyboardFocus += OnCommandLineTextBoxLostKeyboardFocus;
            _margin.CommandLineTextBox.PreviewMouseDown += OnCommandLineTextBoxPreviewMouseDown;
            _editorFormatMap.FormatMappingChanged += OnFormatMappingChanged;
            UpdateForRecordingChanged();
            UpdateTextColor();
        }
Ejemplo n.º 3
0
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            SVsServiceProvider serviceProvider)
            : 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>();
            _fontProperties = new TextEditorFontProperties(serviceProvider);
            _vimApplicationSettings = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;

            uint cookie;
            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
Ejemplo n.º 4
0
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            SVsServiceProvider serviceProvider)
            : 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>();
            _fontProperties     = new TextEditorFontProperties(serviceProvider);

            uint cookie;

            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
Ejemplo n.º 5
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties, IEnumerable<Lazy<IOptionsProviderFactory>> optionsProviderFactories)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties, optionsProviderFactories);
 }
Ejemplo n.º 6
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties, IEnumerable <Lazy <IOptionsProviderFactory> > optionsProviderFactories)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller        = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties, optionsProviderFactories);
 }
Ejemplo n.º 7
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties);
 }
Ejemplo n.º 8
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller        = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties);
 }