public void GetOrCreateVimBuffer_CreateForNewView() { var textView = CreateTextView(); var buffer = _vim.GetOrCreateVimBuffer(textView); Assert.Same(textView, buffer.TextView); }
KeyProcessor IKeyProcessorProvider.GetAssociatedProcessor(IWpfTextView wpfTextView) { var buffer = _vim.GetOrCreateVimBuffer(wpfTextView); var bufferCoordinator = _bufferCoordinatorFactory.GetVimBufferCoordinator(buffer); return(new VsKeyProcessor(_adapter, bufferCoordinator)); }
public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer) { var buffer = _vim.GetOrCreateVimBuffer(wpfTextViewHost.TextView); var editorFormatMap = _editorFormatMapService.GetEditorFormatMap(wpfTextViewHost.TextView); return(new CommandMargin(buffer, editorFormatMap, _optionsProviderFactories)); }
public KeyProcessor GetAssociatedProcessor(ICocoaTextView cocoaTextView) { if (!_vim.VimHost.ShouldCreateVimBuffer(cocoaTextView)) { return(null); } var vimTextBuffer = _vim.GetOrCreateVimBuffer(cocoaTextView); return(new VimKeyProcessor(vimTextBuffer, _keyUtil, _completionBroker, _signatureHelpBroker, _inlineRenameListenerFactory)); }
KeyProcessor IKeyProcessorProvider.GetAssociatedProcessor(IWpfTextView wpfTextView) { if (!_isVisualAssistInstalled) { return(null); } var vimBuffer = _vim.GetOrCreateVimBuffer(wpfTextView); return(new VisualAssistKeyProcessor(vimBuffer)); }
IVimViewInfo IVimWindow.AddVimViewInfo(IWpfTextViewHost textViewHost) { var vimBuffer = _vim.GetOrCreateVimBuffer(textViewHost.TextView); var vimViewInfo = new VimViewInfo() { VimBuffer = vimBuffer, TextViewHost = textViewHost, VimWindow = this }; _vimViewInfoList.Add(vimViewInfo); textViewHost.TextView.Closed += OnTextViewClosed; RaiseChanged(); return(vimViewInfo); }
public ICocoaTextViewMargin CreateMargin( ICocoaTextViewHost wpfTextViewHost, ICocoaTextViewMargin marginContainer) { var textView = wpfTextViewHost?.TextView ?? throw new ArgumentNullException(nameof(wpfTextViewHost)); var vimBuffer = _vim.GetOrCreateVimBuffer(textView); var formatMap = _formatMapService.GetClassificationFormatMap(textView); return(new RelativeLineNumbersMargin( textView, formatMap, _typeRegistryService, vimBuffer.LocalSettings)); }
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; }
public IWpfTextViewMargin CreateMargin( IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer) { var textView = wpfTextViewHost?.TextView ?? throw new ArgumentNullException(nameof(wpfTextViewHost)); var vimBuffer = _vim.GetOrCreateVimBuffer(textView); var formatMap = _formatMapService.GetClassificationFormatMap(textView); var formatProvider = new LineNumberFormatTracker( textView, formatMap, _typeRegistryService); return(new RelativeLineNumbersMargin( textView, formatProvider, vimBuffer.LocalSettings, marginContainer, _protectedOperations)); }
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); }
public KeyProcessor GetAssociatedProcessor(IWpfTextView wpfTextView) { var vimTextBuffer = _vim.GetOrCreateVimBuffer(wpfTextView); return(new VimKeyProcessor(vimTextBuffer, _keyUtil)); }