Beispiel #1
0
        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);
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 internal bool TryGetCommandMargin(IVimBuffer vimBuffer, out CommandMargin commandMargin)
 {
     return(vimBuffer.Properties.TryGetPropertySafe(Key, out commandMargin));
 }
Beispiel #5
0
 internal bool TryGetCommandMargin(IVimBuffer vimBuffer, out CommandMargin commandMargin)
 {
     return vimBuffer.Properties.TryGetPropertySafe(s_key, out commandMargin);
 }