public void RaiseSwitchedMode(SwitchModeEventArgs args) { if (SwitchedMode != null) { SwitchedMode(this, args); } }
private void OnModeChange(object sender, SwitchModeEventArgs args) { if (InRename && _inlineRenameUtil.IsRenameActive && args.ModeArgument.IsCancelOperation) { _inlineRenameUtil.Cancel(); } }
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; } }
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); } }
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(); } }
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; }
private void OnSwitchMode(object sender, SwitchModeEventArgs args) { if (InVimBufferKeyEvent) { _vimBufferKeyEventState.SwitchModeEventArgs = args; } else { if (args.PreviousMode?.ModeKind == ModeKind.Uninitialized) { return; } UpdateForSwitchMode(args.CurrentMode); } }
/// <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)); } }
private void OnSwitchMode(object sender, SwitchModeEventArgs args) { if (_inKeyInputEvent) { _modeSwitch = args.CurrentMode; } else { UpdateForSwitchMode(args.CurrentMode); } }
public void RaiseSwitchedMode(SwitchModeEventArgs args) { SwitchedMode?.Invoke(this, args); }
internal void Clear() { InEvent = false; Message = null; SwitchModeEventArgs = null; }
/// <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; }
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(); } }
private void OnSwitchMode(SwitchModeEventArgs e) { DrawableGridViewModel.ActiveMode = e.SwitchedMode; }
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); }