protected CommandMarginControllerTest()
        {
            _factory = new MockRepository(MockBehavior.Strict);
            _marginControl = new CommandMarginControl();
            _marginControl.CommandLineTextBox.Text = String.Empty;

            _search = _factory.Create<IIncrementalSearch>();
            _search.SetupGet(x => x.InSearch).Returns(false);
            _search.SetupGet(x => x.InPasteWait).Returns(false);
            _vimBuffer = new MockVimBuffer();
            _vimBuffer.IncrementalSearchImpl = _search.Object;
            _vimBuffer.VimImpl = MockObjectFactory.CreateVim(factory: _factory).Object;
            _vimBuffer.CommandModeImpl = _factory.Create<ICommandMode>(MockBehavior.Loose).Object;
            var textBuffer = CreateTextBuffer(new []{""});
            _vimBuffer.TextViewImpl = TextEditorFactoryService.CreateTextView(textBuffer);

            Mock<IVimGlobalSettings> globalSettings = new Mock<IVimGlobalSettings>();
            _vimBuffer.GlobalSettingsImpl = globalSettings.Object;

            var editorFormatMap = _factory.Create<IEditorFormatMap>(MockBehavior.Loose);
            editorFormatMap.Setup(x => x.GetProperties(It.IsAny<string>())).Returns(new ResourceDictionary());

            var parentVisualElement = _factory.Create<FrameworkElement>();

            _controller = new CommandMarginController(
                _vimBuffer,
                parentVisualElement.Object,
                _marginControl,
                VimEditorHost.EditorFormatMapService.GetEditorFormatMap(_vimBuffer.TextView),
                VimEditorHost.ClassificationFormatMapService.GetClassificationFormatMap(_vimBuffer.TextView));
        }
Example #2
0
        protected CommandMarginControllerTest()
        {
            _factory = new MockRepository(MockBehavior.Strict);
            _marginControl = new CommandMarginControl();
            _marginControl.StatusLine = String.Empty;

            var vimBuffer = CreateVimBuffer();
            var editorFormatMap = _factory.Create<IEditorFormatMap>(MockBehavior.Loose);
            editorFormatMap.Setup(x => x.GetProperties(It.IsAny<string>())).Returns(new ResourceDictionary());

            var parentVisualElement = _factory.Create<FrameworkElement>();

            _controller = new CommandMarginController(
                vimBuffer,
                parentVisualElement.Object,
                _marginControl,
                editorFormatMap.Object,
                new List<Lazy<IOptionsProviderFactory>>());
        }
        protected virtual void Create(params string[] lines)
        {
            _factory = new MockRepository(MockBehavior.Strict);
            _marginControl = new CommandMarginControl();
            _marginControl.CommandLineTextBox.Text = String.Empty;
            _vimBuffer = CreateVimBuffer(lines);
            _textBuffer = _vimBuffer.TextBuffer;
            _textView = _vimBuffer.TextView;
            _keyboardDevice = new MockKeyboardDevice();

            var parentVisualElement = _factory.Create<FrameworkElement>();

            _controller = new CommandMarginController(
                _vimBuffer,
                parentVisualElement.Object,
                _marginControl,
                VimEditorHost.EditorFormatMapService.GetEditorFormatMap(_vimBuffer.TextView),
                VimEditorHost.ClassificationFormatMapService.GetClassificationFormatMap(_vimBuffer.TextView));
        }
        public CommandMarginControllerTest()
        {
            _factory = new MockRepository(MockBehavior.Strict);
            _search = _factory.Create<IIncrementalSearch>();
            _search.SetupGet(x => x.InSearch).Returns(false);
            _vimBuffer = new MockVimBuffer();
            _vimBuffer.IncrementalSearchImpl = _search.Object;
            _vimBuffer.VimImpl = MockObjectFactory.CreateVim(factory: _factory).Object;
            _marginControl = new CommandMarginControl();
            _marginControl.StatusLine = String.Empty;

            var editorFormatMap = _factory.Create<IEditorFormatMap>(MockBehavior.Loose);
            editorFormatMap.Setup(x => x.GetProperties(It.IsAny<string>())).Returns(new ResourceDictionary());

            _controller = new CommandMarginController(
                _vimBuffer,
                _marginControl,
                editorFormatMap.Object,
                new List<Lazy<IOptionsProviderFactory>>());
        }
Example #5
0
 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 virtual void Create(params string[] lines)
        {
            _factory = new MockRepository(MockBehavior.Strict);
            _marginControl = new CommandMarginControl();
            _marginControl.StatusLine = String.Empty;
            _vimBuffer = CreateVimBuffer(lines);
            _textBuffer = _vimBuffer.TextBuffer;
            _textView = _vimBuffer.TextView;
            _keyboardDevice = new MockKeyboardDevice();

            var editorFormatMap = _factory.Create<IEditorFormatMap>(MockBehavior.Loose);
            editorFormatMap.Setup(x => x.GetProperties(It.IsAny<string>())).Returns(new ResourceDictionary());

            var parentVisualElement = _factory.Create<FrameworkElement>();

            _controller = new CommandMarginController(
                _vimBuffer,
                parentVisualElement.Object,
                _marginControl,
                editorFormatMap.Object,
                new List<Lazy<IOptionsProviderFactory>>());
        }
Example #7
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap)
 {
     _margin.CommandLineTextBox.Text = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, classificationFormatMap);
 }
Example #8
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);
 }
Example #9
0
 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;
 }
Example #10
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);
 }
Example #11
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties);
 }
Example #12
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IClassificationFormatMap classificationFormatMap)
 {
     _margin.CommandLineTextBox.Text = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, classificationFormatMap);
     _enabled = true;
 }
Example #13
0
 public CommandMargin(IVimBuffer buffer, IEditorFormatMap editorFormatMap, IEnumerable<Lazy<IOptionsProviderFactory>> optionsProviderFactories)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller = new CommandMarginController(buffer, _margin, editorFormatMap, optionsProviderFactories);
 }
Example #14
0
 public CommandMargin(IVimBuffer buffer, IEditorFormatMap editorFormatMap, IEnumerable <Lazy <IOptionsProviderFactory> > optionsProviderFactories)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller        = new CommandMarginController(buffer, _margin, editorFormatMap, optionsProviderFactories);
 }
Example #15
0
 public CommandMargin(FrameworkElement parentVisualElement, IVimBuffer buffer, IEditorFormatMap editorFormatMap, IFontProperties fontProperties)
 {
     _margin.StatusLine = "Welcome to Vim";
     _controller        = new CommandMarginController(buffer, parentVisualElement, _margin, editorFormatMap, fontProperties);
 }
Example #16
0
 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;
 }