private CommandMargin CreateCommandMargin(IVimBuffer vimBuffer) { Contract.Requires(!vimBuffer.TextView.IsClosed); var wpfTextView = (IWpfTextView)vimBuffer.TextView; var editorFormatMap = _editorFormatMapService.GetEditorFormatMap(wpfTextView); var classificationFormatMap = _classificationFormatMapService.GetClassificationFormatMap(wpfTextView); var commandMargin = new CommandMargin(wpfTextView.VisualElement, vimBuffer, editorFormatMap, classificationFormatMap); vimBuffer.Properties.AddProperty(Key, commandMargin); vimBuffer.Closed += delegate { vimBuffer.Properties.RemoveProperty(Key); }; return(commandMargin); }
private CommandMargin CreateCommandMargin(IVimBuffer vimBuffer) { Contract.Requires(!vimBuffer.TextView.IsClosed); var wpfTextView = (IWpfTextView)vimBuffer.TextView; var editorFormatMap = _editorFormatMapService.GetEditorFormatMap(wpfTextView); var classificationFormatMap = _classificationFormatMapService.GetClassificationFormatMap(wpfTextView); var commandMargin = new CommandMargin(wpfTextView.VisualElement, vimBuffer, editorFormatMap, classificationFormatMap); vimBuffer.Properties.AddProperty(s_key, commandMargin); vimBuffer.Closed += delegate { vimBuffer.Properties.RemoveProperty(s_key); }; return commandMargin; }
private CommandMargin CreateCommandMargin(IVimBuffer vimBuffer) { Contract.Requires(!vimBuffer.TextView.IsClosed); var wpfTextView = (IWpfTextView)vimBuffer.TextView; var editorFormatMap = _editorFormatMapService.GetEditorFormatMap(wpfTextView); var classificationFormatMap = _classificationFormatMapService.GetClassificationFormatMap(wpfTextView); var commonOperations = _commonOperationsFactory.GetCommonOperations(vimBuffer.VimBufferData); var commandMargin = new CommandMargin(wpfTextView.VisualElement, vimBuffer, editorFormatMap, classificationFormatMap, commonOperations, _clipboardDevice, _isFirstCommandMargin); _isFirstCommandMargin = false; vimBuffer.Properties.AddProperty(s_key, commandMargin); vimBuffer.Closed += delegate { vimBuffer.Properties.RemoveProperty(s_key); }; return(commandMargin); }
internal bool TryGetCommandMargin(IVimBuffer vimBuffer, out CommandMargin commandMargin) { return(vimBuffer.Properties.TryGetPropertySafe(Key, out commandMargin)); }
internal bool TryGetCommandMargin(IVimBuffer vimBuffer, out CommandMargin commandMargin) { return vimBuffer.Properties.TryGetPropertySafe(s_key, out commandMargin); }