Пример #1
0
 public void RaiseSwitchedMode(SwitchModeEventArgs args)
 {
     if (SwitchedMode != null)
     {
         SwitchedMode(this, args);
     }
 }
Пример #2
0
 private void OnModeChange(object sender, SwitchModeEventArgs args)
 {
     if (InRename && _inlineRenameUtil.IsRenameActive && args.ModeArgument.IsCancelOperation)
     {
         _inlineRenameUtil.Cancel();
     }
 }
Пример #3
0
        private void KeyInputEventComplete()
        {
            _inKeyInputEvent = false;

            try
            {
                if (!String.IsNullOrEmpty(_message))
                {
                    _margin.StatusLine = _message;
                }
                else if (_modeSwitchEventArgs != null)
                {
                    UpdateForSwitchMode(_modeSwitchEventArgs.PreviousMode, _modeSwitchEventArgs.CurrentMode);
                }
                else
                {
                    UpdateForNoEvent();
                }
            }
            finally
            {
                _message             = null;
                _modeSwitchEventArgs = null;
            }
        }
Пример #4
0
        public void SwitchMode_NoActionOutsideExternalEdit()
        {
            Setup("cat", "tree", "dog");
            var mode = _factory.Create <IMode>();

            mode.SetupGet(x => x.ModeKind).Returns(ModeKind.Normal);
            var args = new SwitchModeEventArgs(FSharpOption.Create(mode.Object), null);

            _buffer.Raise(x => x.SwitchedMode += null, null, args);
        }
 private void OnSwitchMode(object sender, SwitchModeEventArgs args)
 {
     if (InVimBufferKeyEvent)
     {
         _vimBufferKeyEventState.SwitchModeEventArgs = args;
     }
     else
     {
         UpdateForSwitchMode(args.CurrentMode);
     }
 }
Пример #6
0
 private void OnSwitchedMode(object sender, SwitchModeEventArgs args)
 {
     if (args.PreviousMode.IsSome() && args.PreviousMode.Value.ModeKind == ModeKind.ExternalEdit)
     {
         // If we're in the middle of an external edit and the mode switches then we
         // need to record the current edit markers so we can ignore them going
         // forward.  Further updates which cause these markers to be rendered shouldn't
         // cause us to re-enter external edit mode
         SaveCurrentEditorMarkersForIgnore();
     }
 }
Пример #7
0
 private void OnSwitchMode(object sender, SwitchModeEventArgs args)
 {
     if (_inKeyInputEvent)
     {
         _modeSwitchEventArgs = args;
     }
     else
     {
         UpdateForSwitchMode(args.PreviousMode, args.CurrentMode);
     }
 }
 internal void Clear()
 {
     if (!InEvent)
     {
         // This might be a nested key input event, for example
         // if a macro is being replayed. Only clear the event
         // state for the outermost key input event so we don't
         // lose messages.
         Message = null;
     }
     SwitchModeEventArgs = null;
 }
Пример #9
0
        private void OnSwitchMode(object sender, SwitchModeEventArgs args)
        {
            if (InVimBufferKeyEvent)
            {
                _vimBufferKeyEventState.SwitchModeEventArgs = args;
            }
            else
            {
                if (args.PreviousMode?.ModeKind == ModeKind.Uninitialized)
                {
                    return;
                }

                UpdateForSwitchMode(args.CurrentMode);
            }
        }
Пример #10
0
        /// <summary>
        /// Handles the switch mode event of the ITextBuffer.  We need to monitor this in case 
        /// the user exits external edit mode while edit tags are still around.  These need to 
        /// be saved
        /// </summary>
        private void OnSwitchedMode(object sender, SwitchModeEventArgs args)
        {
            // If we're forcing the leave of external edit then that code is responsible for 
            // saving the ignore markers
            if (_leavingExternalEdit)
            {
                return;
            }

            if (args.PreviousMode.ModeKind == ModeKind.ExternalEdit)
            {
                // If we're in the middle of an external edit and the mode switches then we 
                // need to record the current edit markers so we can ignore them going 
                // forward.  Further updates which cause these markers to be rendered shouldn't
                // cause us to re-enter external edit mode
                SetIgnoredExternalEditSpans(GetExternalEditSpans(CheckKind.All));
            }
        }
Пример #11
0
 private void OnSwitchMode(object sender, SwitchModeEventArgs args)
 {
     if (_inKeyInputEvent)
     {
         _modeSwitch = args.CurrentMode;
     }
     else
     {
         UpdateForSwitchMode(args.CurrentMode);
     }
 }
Пример #12
0
 public void RaiseSwitchedMode(SwitchModeEventArgs args)
 {
     if (SwitchedMode != null)
     {
         SwitchedMode(this, args);
     }
 }
Пример #13
0
 public void RaiseSwitchedMode(SwitchModeEventArgs args)
 {
     SwitchedMode?.Invoke(this, args);
 }
Пример #14
0
 internal void Clear()
 {
     InEvent = false;
     Message = null;
     SwitchModeEventArgs = null;
 }
Пример #15
0
        /// <summary>
        /// Handles the switch mode event of the ITextBuffer.  We need to monitor this in case 
        /// the user exits external edit mode while edit tags are still around.  These need to 
        /// be saved
        /// </summary>
        private void OnSwitchedMode(object sender, SwitchModeEventArgs args)
        {
            // If we're forcing the leave of external edit then that code is responsible for
            // saving the ignore markers
            if (_leavingExternalEdit)
            {
                return;
            }

            if (args.PreviousMode.IsSome() && args.PreviousMode.Value.ModeKind == ModeKind.ExternalEdit)
            {
                // If we're in the middle of an external edit and the mode switches then we
                // need to record the current edit markers so we can ignore them going
                // forward.  Further updates which cause these markers to be rendered shouldn't
                // cause us to re-enter external edit mode
                SetIgnoredExternalEditSpans(GetExternalEditSpans(CheckKind.All));
            }
        }
 internal void Clear()
 {
     Message             = null;
     SwitchModeEventArgs = null;
 }
Пример #17
0
 private void OnSwitchMode(object sender, SwitchModeEventArgs args)
 {
     if (InVimBufferKeyEvent)
     {
         _vimBufferKeyEventState.SwitchModeEventArgs = args;
     }
     else
     {
         UpdateForSwitchMode(args.CurrentMode);
     }
 }
Пример #18
0
        private void KeyInputEventComplete()
        {
            _inKeyInputEvent = false;

            try
            {
                if (!String.IsNullOrEmpty(_message))
                {
                    _margin.StatusLine = _message;
                }
                else if (_modeSwitchEventArgs != null)
                {
                    UpdateForSwitchMode(_modeSwitchEventArgs.PreviousMode, _modeSwitchEventArgs.CurrentMode);
                }
                else
                {
                    UpdateForNoEvent();
                }
            }
            finally
            {
                _message = null;
                _modeSwitchEventArgs = null;
            }
        }
Пример #19
0
 private void OnSwitchedMode(object sender, SwitchModeEventArgs args)
 {
     if ( args.PreviousMode.IsSome() && args.PreviousMode.Value.ModeKind == ModeKind.ExternalEdit)
     {
         // If we're in the middle of an external edit and the mode switches then we
         // need to record the current edit markers so we can ignore them going
         // forward.  Further updates which cause these markers to be rendered shouldn't
         // cause us to re-enter external edit mode
         SaveCurrentEditorMarkersForIgnore();
     }
 }
Пример #20
0
 private void OnSwitchMode(SwitchModeEventArgs e)
 {
     DrawableGridViewModel.ActiveMode = e.SwitchedMode;
 }
Пример #21
0
 public void SwitchMode_NoActionOutsideExternalEdit()
 {
     Setup("cat", "tree", "dog");
     var mode = _factory.Create<IMode>();
     mode.SetupGet(x => x.ModeKind).Returns(ModeKind.Normal);
     var args = new SwitchModeEventArgs(FSharpOption.Create(mode.Object), null);
     _buffer.Raise(x => x.SwitchedMode += null, null, args);
 }
Пример #22
0
 internal void Clear()
 {
     Message = null;
     SwitchModeEventArgs = null;
 }