Esempio n. 1
0
        ICommandTarget ICommandTargetFactory.CreateCommandTarget(IOleCommandTarget nextCommandTarget, IVimBufferCoordinator vimBufferCoordinator)
        {
            var vimBuffer           = vimBufferCoordinator.VimBuffer;
            var displayWindowBroker = _displayWindowBrokerFactory.GetDisplayWindowBroker(vimBuffer.TextView);
            var commonOperations    = _commonOperationsFactory.GetCommonOperations(vimBuffer.VimBufferData);

            return(new StandardCommandTarget(vimBufferCoordinator, _textManager, commonOperations, displayWindowBroker, nextCommandTarget));
        }
Esempio n. 2
0
        private CommandMargin CreateCommandMargin(IVimBuffer vimBuffer)
        {
            Contract.Requires(!vimBuffer.TextView.IsClosed);

            var wpfTextView             = (IWpfTextView)vimBuffer.TextView;
            var editorFormatMap         = _editorFormatMapService.GetEditorFormatMap(wpfTextView);
            var classificationFormatMap = _classificationFormatMapService.GetClassificationFormatMap(wpfTextView);
            var commonOperations        = _commonOperationsFactory.GetCommonOperations(vimBuffer.VimBufferData);
            var commandMargin           = new CommandMargin(wpfTextView.VisualElement, vimBuffer, editorFormatMap, classificationFormatMap, commonOperations);

            vimBuffer.Properties.AddProperty(s_key, commandMargin);
            vimBuffer.Closed += delegate { vimBuffer.Properties.RemoveProperty(s_key); };

            return(commandMargin);
        }