Esempio n. 1
0
        /// <summary>
        /// Go to the 'count' tab in the given direction.  If the count exceeds the count in
        /// the given direction then it should wrap around to the end of the list of items
        /// </summary>
        public override void GoToNextTab(Vim.Path direction, int count)
        {
            // First get the index of the current tab so we know where we are incrementing
            // from.  Make sure to check that our view is actually a part of the active
            // views
            var windowFrameState = _sharedService.GetWindowFrameState();
            var index            = windowFrameState.ActiveWindowFrameIndex;

            if (index == -1)
            {
                return;
            }

            var childCount = windowFrameState.WindowFrameCount;

            count = count % childCount;
            if (direction.IsForward)
            {
                index += count;
                index %= childCount;
            }
            else
            {
                index -= count;
                if (index < 0)
                {
                    index += childCount;
                }
            }

            _sharedService.GoToTab(index);
        }
Esempio n. 2
0
 public override void GoToTab(int index)
 {
     _sharedService.GoToTab(index);
 }