internal void RunConflictingKeyBindingStateCheck(IVimBuffer vimBuffer) { _vimFirstKeyInputSet = CreateVimFirstKeyInputSet(vimBuffer); // Calculate the current conflicting state. Can't cache the snapshot here because we don't // receive any notifications when key bindings change in Visual Studio. Have to assume they // change at all times var snapshot = CreateCommandKeyBindingSnapshot(_vimFirstKeyInputSet); ConflictingKeyBindingState = snapshot.Conflicting.Any() ? ConflictingKeyBindingState.FoundConflicts : ConflictingKeyBindingState.ConflictsIgnoredOrResolved; }
internal void UpdateConflictingState(ConflictingKeyBindingState state, CommandKeyBindingSnapshot snapshot) { _snapshot = snapshot; ConflictingKeyBindingState = state; }
internal void RunConflictingKeyBindingStateCheck(IEnumerable<KeyInput> neededInputs, Action<ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete) { if (_snapshot != null) { onComplete(_state, _snapshot); return; } var util = new KeyBindingUtil(_dte, GetOrCreateImportantScopeSet()); var set = new HashSet<KeyInput>(neededInputs); _snapshot = util.CreateCommandKeyBindingSnapshot(set); ConflictingKeyBindingState = _snapshot.Conflicting.Any() ? ConflictingKeyBindingState.FoundConflicts : ConflictingKeyBindingState.ConflictsIgnoredOrResolved; }
internal void ResolveAnyConflicts() { if (_snapshot == null || _state != ConflictingKeyBindingState.FoundConflicts) { return; } if (_optionsDialogService.ShowConflictingKeyBindingsDialog(_snapshot)) { ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved; _snapshot = null; } }
internal void ResetConflictingKeyBindingState() { ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked; _snapshot = null; }
internal void IgnoreAnyConflicts() { ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved; _snapshot = null; }
internal void RunConflictingKeyBindingStateCheck(IEnumerable<KeyInput> neededInputs, Action<ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete) { if (_snapshot != null) { onComplete(_state, _snapshot); return; } var set = new HashSet<KeyInput>(neededInputs); var snapshot = CreateCommandKeyBindingSnapshot(set); ConflictingKeyBindingState = snapshot.Conflicting.Any() ? ConflictingKeyBindingState.FoundConflicts : ConflictingKeyBindingState.ConflictsIgnoredOrResolved; }
internal void ResolveAnyConflicts() { if (_vimFirstKeyInputSet == null || _state != ConflictingKeyBindingState.FoundConflicts) { return; } _keyboardOptionsProvider.ShowOptionsPage(); ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved; }
internal void ResetConflictingKeyBindingState() { ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked; }
internal void RunConflictingKeyBindingStateCheck(IVimBuffer buffer) { // Create the set of KeyInput values which are handled by VsVim var needed = buffer.AllModes.Select(x => x.CommandNames).SelectMany(x => x).ToList(); needed.Add(KeyInputSet.NewOneKeyInput(buffer.LocalSettings.GlobalSettings.DisableAllCommand)); var set = new HashSet<KeyInput>(needed.Select(x => x.KeyInputs.First())); // Take a snapshot based on the current state of the DTE commands and store it // and the conflicting state _snapshot = CreateCommandKeyBindingSnapshot(set); ConflictingKeyBindingState = _snapshot.Conflicting.Any() ? ConflictingKeyBindingState.FoundConflicts : ConflictingKeyBindingState.ConflictsIgnoredOrResolved; }
public void RunConflictingKeyBindingStateCheck(IEnumerable<KeyInput> neededInputs, Action<ConflictingKeyBindingState, CommandKeyBindingSnapshot> onComplete) { if (_snapshot != null) { onComplete(_state, _snapshot); return; } var util = new KeyBindingUtil(_dte); var set = new HashSet<KeyInput>(neededInputs); _snapshot = util.CreateCommandKeyBindingSnapshot(set); if (_snapshot.Conflicting.Any()) { ConflictingKeyBindingState = ConflictingKeyBindingState.FoundConflicts; } else { ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved; } }