public void Create(ITextView textView) { _textView = textView; _buffer = _textView.TextBuffer; _snapshot = _buffer.CurrentSnapshot; _buffer.Changed += delegate { _snapshot = _buffer.CurrentSnapshot; }; _settings = new Vim.GlobalSettings(); _localSettings = new LocalSettings(_settings, _textView); _utilRaw = new TextViewMotionUtil(_textView, _localSettings); _util = _utilRaw; }
public void Create(ITextView textView) { _textView = textView; _buffer = _textView.TextBuffer; _snapshot = _buffer.CurrentSnapshot; _buffer.Changed += delegate { _snapshot = _buffer.CurrentSnapshot; }; _settings = new Vim.GlobalSettings(); _localSettings = new LocalSettings(_settings, _textView); _markMap = new MarkMap(new TrackingLineColumnService()); _utilRaw = new TextViewMotionUtil( _textView, _markMap, _localSettings); _util = _utilRaw; }
public void CreateCore(ITextViewMotionUtil motionUtil, params string[] lines) { _view = EditorUtil.CreateView(lines); _view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, 0)); _map = new RegisterMap(MockObjectFactory.CreateClipboardDevice().Object); _editorOperations = new Mock<IEditorOperations>(); _incrementalSearch = new Mock<IIncrementalSearch>(MockBehavior.Strict); _jumpList = new Mock<IJumpList>(MockBehavior.Strict); _statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict); _changeTracker = new Mock<IChangeTracker>(MockBehavior.Strict); _foldManager = new Mock<IFoldManager>(MockBehavior.Strict); _visualSpanCalculator = new Mock<IVisualSpanCalculator>(MockBehavior.Strict); _host = new Mock<IVimHost>(MockBehavior.Loose); _displayWindowBroker = new Mock<IDisplayWindowBroker>(MockBehavior.Strict); _displayWindowBroker.SetupGet(x => x.IsCompletionActive).Returns(false); _displayWindowBroker.SetupGet(x => x.IsSignatureHelpActive).Returns(false); _displayWindowBroker.SetupGet(x => x.IsSmartTagSessionActive).Returns(false); _bufferData = MockRepository.CreateVimBuffer( _view, "test", MockRepository.CreateVim(_map, changeTracker: _changeTracker.Object, host: _host.Object).Object, _jumpList.Object); _operations = new Mock<IOperations>(MockBehavior.Strict); _operations.SetupGet(x => x.EditorOperations).Returns(_editorOperations.Object); _operations.SetupGet(x => x.TextView).Returns(_view); _operations.SetupGet(x => x.FoldManager).Returns(_foldManager.Object); motionUtil = motionUtil ?? new TextViewMotionUtil(_view, new Vim.LocalSettings( new Vim.GlobalSettings(), _view)); var capture = new MotionCapture(_host.Object, _view, motionUtil, new MotionCaptureGlobalData()); var runner = new CommandRunner(_view, _map, (IMotionCapture)capture, _statusUtil.Object); _modeRaw = new Vim.Modes.Normal.NormalMode( _bufferData.Object, _operations.Object, _incrementalSearch.Object, _statusUtil.Object, _displayWindowBroker.Object, (ICommandRunner)runner, (IMotionCapture)capture, _visualSpanCalculator.Object); _mode = _modeRaw; _mode.OnEnter(ModeArgument.None); }
public void Create(ITextViewMotionUtil motionUtil, params string[] lines) { CreateCore(motionUtil, lines); }