public void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateBuffer(lines);
     _factory = new MockRepository(MockBehavior.Strict);
     _textCaret = _factory.Create<ITextCaret>();
     _textView = MockObjectFactory.CreateTextView(textBuffer: _textBuffer, caret: _textCaret.Object, factory: _factory);
     _buffer = MockObjectFactory.CreateVimBuffer(textView: _textView.Object, factory: _factory);
     _operations = _factory.Create<ICommonOperations>();
     _operations.Setup(x => x.MoveCaretToPoint(It.IsAny<SnapshotPoint>()));
     _operations.Setup(x => x.EnsureCaretOnScreenAndTextExpanded());
     _modeRaw = new SubstituteConfirmMode(_buffer.Object, _operations.Object);
     _mode = _modeRaw;
 }
Exemplo n.º 2
0
 public void Create(params string[] lines)
 {
     _textBuffer = EditorUtil.CreateBuffer(lines);
     _factory    = new MockRepository(MockBehavior.Strict);
     _textCaret  = _factory.Create <ITextCaret>();
     _textView   = MockObjectFactory.CreateTextView(textBuffer: _textBuffer, caret: _textCaret.Object, factory: _factory);
     _buffer     = MockObjectFactory.CreateVimBuffer(textView: _textView.Object, factory: _factory);
     _operations = _factory.Create <ICommonOperations>();
     _operations.Setup(x => x.MoveCaretToPoint(It.IsAny <SnapshotPoint>()));
     _operations.Setup(x => x.EnsureCaretOnScreenAndTextExpanded());
     _modeRaw = new SubstituteConfirmMode(_buffer.Object, _operations.Object);
     _mode    = _modeRaw;
 }
Exemplo n.º 3
0
        public void Create(params string[] lines)
        {
            _textView = CreateTextView(lines);
            _textBuffer = _textView.TextBuffer;
            _factory = new MockRepository(MockBehavior.Strict);
            _editorOperations = _factory.Create<IEditorOperations>();
            _operations = _factory.Create<ICommonOperations>();
            _operations.Setup(x => x.MoveCaretToPoint(It.IsAny<SnapshotPoint>(), It.IsAny<ViewFlags>()));
            _operations.Setup(x => x.GetReplaceData(It.IsAny<SnapshotPoint>())).Returns(new ReplaceData(Environment.NewLine, Vim.GlobalSettings.Magic, 1));
            _operations.SetupGet(x => x.EditorOperations).Returns(_editorOperations.Object);

            var vimBufferData = CreateVimBufferData(_textView);
            _modeRaw = new SubstituteConfirmMode(vimBufferData, _operations.Object);
            _mode = _modeRaw;
        }
Exemplo n.º 4
0
        internal void Create(params string[] lines)
        {
            _textView         = CreateTextView(lines);
            _textBuffer       = _textView.TextBuffer;
            _factory          = new MockRepository(MockBehavior.Strict);
            _editorOperations = _factory.Create <IEditorOperations>();
            _operations       = _factory.Create <ICommonOperations>();
            _operations.Setup(x => x.MoveCaretToPoint(It.IsAny <SnapshotPoint>(), It.IsAny <ViewFlags>()));
            _operations.Setup(x => x.GetReplaceData(It.IsAny <SnapshotPoint>())).Returns(new VimRegexReplaceData("", Environment.NewLine, Vim.GlobalSettings.Magic, VimRegexReplaceCount.One));
            _operations.SetupGet(x => x.EditorOperations).Returns(_editorOperations.Object);

            var vimBufferData = CreateVimBufferData(_textView);

            _modeRaw = new SubstituteConfirmMode(vimBufferData, _operations.Object);
            _mode    = _modeRaw;
        }
Exemplo n.º 5
0
        public void Create(params string[] lines)
        {
            _textBuffer = EditorUtil.CreateTextBuffer(lines);
            _factory = new MockRepository(MockBehavior.Strict);
            _textCaret = _factory.Create<ITextCaret>();
            _textView = MockObjectFactory.CreateTextView(textBuffer: _textBuffer, caret: _textCaret.Object, factory: _factory);
            _editorOperations = _factory.Create<IEditorOperations>();
            _operations = _factory.Create<ICommonOperations>();
            _operations.Setup(x => x.MoveCaretToPoint(It.IsAny<SnapshotPoint>()));
            _operations.Setup(x => x.MoveCaretToPointAndEnsureVisible(It.IsAny<SnapshotPoint>()));
            _operations.SetupGet(x => x.EditorOperations).Returns(_editorOperations.Object);

            var vimBufferData = CreateVimBufferData(_textView.Object);
            _modeRaw = new SubstituteConfirmMode(vimBufferData, _operations.Object);
            _mode = _modeRaw;
        }
Exemplo n.º 6
0
        private static string GetStatusSubstituteConfirm(ISubstituteConfirmMode mode)
        {
            var replace = mode.CurrentSubstitute.SomeOrDefault("");

            return(string.Format(Resources.SubstituteConfirmBannerFormat, replace));
        }
Exemplo n.º 7
0
 private static string GetStatusSubstituteConfirm(ISubstituteConfirmMode mode)
 {
     var replace = mode.CurrentSubstitute.SomeOrDefault("");
     return String.Format(Resources.SubstituteConfirmBannerFormat, replace);
 }
Exemplo n.º 8
0
        private static string GetStatusSubstituteConfirm(ISubstituteConfirmMode mode)
        {
            var replace = mode.CurrentSubstitute.SomeOrDefault("");

            return(string.Format("replace with {0} (y/n/a/q/l/^E/^Y)?", replace));
        }