Example #1
0
        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;
        }
Example #2
0
 internal void UpdateConflictingState(ConflictingKeyBindingState state, CommandKeyBindingSnapshot snapshot)
 {
     _snapshot = snapshot;
     ConflictingKeyBindingState = state;
 }
Example #3
0
        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;
        }
Example #4
0
        internal void ResolveAnyConflicts()
        {
            if (_snapshot == null || _state != ConflictingKeyBindingState.FoundConflicts)
            {
                return;
            }

            if (_optionsDialogService.ShowConflictingKeyBindingsDialog(_snapshot))
            {
                ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
                _snapshot = null;
            }
        }
Example #5
0
 internal void ResetConflictingKeyBindingState()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked;
     _snapshot = null;
 }
Example #6
0
 internal void IgnoreAnyConflicts()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
     _snapshot = null;
 }
Example #7
0
        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;
        }
Example #8
0
        internal void ResolveAnyConflicts()
        {
            if (_vimFirstKeyInputSet == null || _state != ConflictingKeyBindingState.FoundConflicts)
            {
                return;
            }

            _keyboardOptionsProvider.ShowOptionsPage();
            ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
        }
Example #9
0
 internal void ResetConflictingKeyBindingState()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked;
 }
Example #10
0
        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;
        }
Example #11
0
 internal void ResetConflictingKeyBindingState()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked;
     _snapshot = null;
 }
Example #12
0
 internal void UpdateConflictingState(ConflictingKeyBindingState state, CommandKeyBindingSnapshot snapshot)
 {
     _snapshot = snapshot;
     ConflictingKeyBindingState = state;
 }
Example #13
0
 internal void IgnoreAnyConflicts()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.ConflictsIgnoredOrResolved;
     _snapshot = null;
 }
Example #14
0
        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;
            }
        }
Example #15
0
 internal void ResetConflictingKeyBindingState()
 {
     ConflictingKeyBindingState = ConflictingKeyBindingState.HasNotChecked;
 }