public void RunConflictingKeyBindingStateCheck_SetSnapshot() { Create("::d", "::ctrl+h", "::b"); var vimBuffer = CreateVimBuffer(""); _service.RunConflictingKeyBindingStateCheck(vimBuffer); Assert.NotNull(_serviceRaw.ConflictingKeyBindingState); Assert.Equal(ConflictingKeyBindingState.FoundConflicts, _serviceRaw.ConflictingKeyBindingState); }
void IWpfTextViewCreationListener.TextViewCreated(IWpfTextView textView) { // Load the VimRC file if we haven't tried yet MaybeLoadVimRc(); // Create the IVimBuffer after loading the VimRc so that it gets the appropriate // settings var buffer = _vim.GetOrCreateBuffer(textView); Action doCheck = () => { // Run the key binding check now if (_keyBindingService.ConflictingKeyBindingState == ConflictingKeyBindingState.HasNotChecked) { if (Settings.Settings.Default.IgnoredConflictingKeyBinding) { _keyBindingService.IgnoreAnyConflicts(); } else { _keyBindingService.RunConflictingKeyBindingStateCheck(buffer, (x, y) => { }); } } }; Dispatcher.CurrentDispatcher.BeginInvoke(doCheck, null); }
void IWpfTextViewCreationListener.TextViewCreated(IWpfTextView textView) { // Load the VimRC file if we haven't tried yet MaybeLoadVimRc(); // Create the IVimBuffer after loading the VimRc so that it gets the appropriate // settings var buffer = _vim.GetOrCreateVimBuffer(textView); // Save the tab size and expand tab in case we need to reset them later var bufferData = new BufferData { TabStop = buffer.LocalSettings.TabStop, ExpandTab = buffer.LocalSettings.ExpandTab, Number = buffer.LocalSettings.Number }; _bufferMap[buffer] = bufferData; Action doCheck = () => { // Run the key binding check now if (_keyBindingService.ConflictingKeyBindingState == ConflictingKeyBindingState.HasNotChecked) { if (Settings.Settings.Default.IgnoredConflictingKeyBinding) { _keyBindingService.IgnoreAnyConflicts(); } else { _keyBindingService.RunConflictingKeyBindingStateCheck(buffer, (x, y) => { }); } } }; _protectedOperations.BeginInvoke(doCheck); }