private void Create2( ModeKind kind = ModeKind.VisualCharacter, params string[] lines) { _textView = CreateTextView(lines); _textBuffer = _textView.TextBuffer; var vimTextBuffer = Vim.CreateVimTextBuffer(_textBuffer); var vimBufferData = CreateVimBufferData(vimTextBuffer, _textView); var visualKind = VisualKind.OfModeKind(kind).Value; _selection = _textView.Selection; _factory = new MockRepository(MockBehavior.Strict); _tracker = _factory.Create <ISelectionTracker>(); _tracker.Setup(x => x.Start()); _tracker.Setup(x => x.UpdateSelection()); _tracker.SetupGet(x => x.IsRunning).Returns(true); _operations = _factory.Create <ICommonOperations>(); _operations.SetupGet(x => x.TextView).Returns(_textView); _commandUtil = _factory.Create <ICommandUtil>(); var motionUtil = new MotionUtil(vimBufferData, _operations.Object); var capture = new MotionCapture(vimBufferData, new IncrementalSearch(vimBufferData, _operations.Object)); var runner = new CommandRunner( _textView, Vim.RegisterMap, capture, _commandUtil.Object, (new Mock <IStatusUtil>()).Object, VisualKind.Character); _modeRaw = new VisualMode(vimBufferData, _operations.Object, motionUtil, visualKind, runner, capture, _tracker.Object); _mode = _modeRaw; _mode.OnEnter(ModeArgument.None); }
private void Create(VisualKind kind, int caretPosition, params string[] lines) { _textView = CreateTextView(lines); _textView.MoveCaretTo(caretPosition); _globalSettings = new GlobalSettings(); _incrementalSearch = new Mock <IIncrementalSearch>(MockBehavior.Loose); _tracker = new SelectionTracker(_textView, _globalSettings, _incrementalSearch.Object, kind); _tracker.Start(); }
private void Create(VisualKind kind, int caretPosition, params string[] lines) { _textView = CreateTextView(lines); _textView.MoveCaretTo(caretPosition); _globalSettings = new GlobalSettings(); var localSettings = new LocalSettings(_globalSettings); var vimTextBuffer = MockObjectFactory.CreateVimTextBuffer(_textView.TextBuffer, localSettings); _vimBufferData = MockObjectFactory.CreateVimBufferData(vimTextBuffer.Object, _textView); _incrementalSearch = new Mock<IIncrementalSearch>(MockBehavior.Loose); _tracker = new SelectionTracker(_vimBufferData, _incrementalSearch.Object, kind); _tracker.Start(); }
private void Create(VisualKind kind, int caretPosition, params string[] lines) { _textView = CreateTextView(lines); _textView.MoveCaretTo(caretPosition); _globalSettings = new GlobalSettings(); var localSettings = new LocalSettings(_globalSettings); var vimTextBuffer = MockObjectFactory.CreateVimTextBuffer(_textView.TextBuffer, localSettings); _vimBufferData = MockObjectFactory.CreateVimBufferData(vimTextBuffer.Object, _textView); _incrementalSearch = new Mock <IIncrementalSearch>(MockBehavior.Loose); _tracker = new SelectionTracker(_vimBufferData, _incrementalSearch.Object, kind); _tracker.Start(); }
private void Create(VisualKind kind, params string[] lines) { Create(kind, 0, lines); }
internal static VisualSpan CreateVisualSpanSingle( SnapshotSpan span, VisualKind kind = null) { return VisualSpan.NewSingle( kind ?? VisualKind.Line, span); }
internal static Command CreateVisualCommand( string name = "c", CommandFlags? flags = null, VisualKind kind = null, Func<FSharpOption<int>, Register, VisualSpan, CommandResult> func = null) { var flagsArg = flags ?? CommandFlags.None; kind = kind ?? VisualKind.Line; if (func == null) { func = (x, y, z) => CommandResult.NewCompleted(ModeSwitch.NoSwitch); } return Command.NewVisualCommand( KeyNotationUtil.StringToKeyInputSet(name), flagsArg, kind, func.ToFSharpFunc()); }
private void Create(VisualKind kind, int caretPosition, params string[] lines) { _textView = CreateTextView(lines); _textView.MoveCaretTo(caretPosition); _globalSettings = new GlobalSettings(); _incrementalSearch = new Mock<IIncrementalSearch>(MockBehavior.Loose); _tracker = new SelectionTracker(_textView, _globalSettings, _incrementalSearch.Object, kind); _tracker.Start(); }
private void Create(VisualKind kind, params string[] lines) { Create(kind, 0, lines); }
private void Create(VisualKind kind, int caretPosition, params string[] lines) { _view = EditorUtil.CreateView(lines); _view.MoveCaretTo(caretPosition); _settings = new Vim.GlobalSettings(); _tracker = new SelectionTracker(_view, _settings, kind); _tracker.Start(); }