예제 #1
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            if (_jumpControler != null && _jumpControler.Active())
            {
                return;
            }

            IVsTextView view = myViewProvider.GetActiveView();

            if (view == null)
            {
                Debug.WriteLine("AceJumpCommand.cs | MenuItemCallback | could not retrieve current view");
                return;
            }

            var textView = myViewProvider.GetActiveWpfView(view);

            _jumpControler?.Close();
            var ace = new AceJump.AceJump();

            ace.SetView(textView);

            _jumpControler = new JumpControler(ace);
            _jumpControler.ShowJumpEditor();


            TryDisableVsVim();
            CreateInputListener(view, textView);
        }
예제 #2
0
        public KeyProcessor GetAssociatedProcessor(IWpfTextView wpfTextView)
        {
            var aceJump         = new AceJump();
            var aceKeyProcessor = new AceKeyProcessor(aceJump);

            aceJump.SetView(wpfTextView);
            return(aceKeyProcessor);
        }