Exemple #1
0
        public void MoveViewDown1()
        {
            var view1      = _factory.Create <IWpfTextView>();
            var view2      = _factory.Create <IWpfTextView>();
            var codeWindow = _adapter.MakeCodeWindow(view2.Object, _factory);
            var vsView1    = codeWindow.MakePrimaryView(_adapter, view1.Object, _factory);
            var vsView2    = codeWindow.MakeSecondaryView(_adapter, view2.Object, _factory);

            vsView1.Setup(x => x.SendExplicitFocus()).Returns(VSConstants.E_FAIL).Verifiable();
            Assert.False(_manager.MoveViewDown(view2.Object));
            _factory.Verify();
        }
Exemple #2
0
        public override void MoveFocus(ITextView textView, Direction direction)
        {
            bool result;

            switch (direction)
            {
            case Direction.Up:
                result = _textManager.MoveViewUp(textView);
                break;

            case Direction.Down:
                result = _textManager.MoveViewDown(textView);
                break;

            case Direction.Left:
                result = MoveFocusHorizontally(-1);
                break;

            case Direction.Right:
                result = MoveFocusHorizontally(1);
                break;

            default:
                throw Contract.GetInvalidEnumException(direction);
            }

            if (!result)
            {
                _vim.ActiveStatusUtil.OnError("Can't move focus");
            }
        }
Exemple #3
0
        public override HostResult MoveFocus(ITextView textView, Direction direction)
        {
            bool result = false;

            switch (direction)
            {
            case Direction.Up:
                result = _textManager.MoveViewUp(textView);
                break;

            case Direction.Down:
                result = _textManager.MoveViewDown(textView);
                break;
            }

            return(result ? HostResult.Success : HostResult.NewError("Not Implemented"));
        }
Exemple #4
0
        public override HostResult MoveFocus(ITextView textView, Direction direction)
        {
            bool result = false;

            if (direction.IsUp)
            {
                result = _textManager.MoveViewUp(textView);
            }
            else if (direction.IsDown)
            {
                result = _textManager.MoveViewDown(textView);
            }
            else if (direction.IsLeft || direction.IsRight)
            {
                result = false;
            }

            return(result ? HostResult.Success : HostResult.NewError("Not Implemented"));
        }
Exemple #5
0
 public override void MoveViewDown(ITextView textView)
 {
     _textManager.MoveViewDown(textView);
 }