internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _controlCharUtil     = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Beispiel #2
0
        internal BlockCaret(
            IVimBufferData vimBufferData,
            IClassificationFormatMap classificationFormatMap,
            IEditorFormatMap formatMap,
            IAdornmentLayer layer,
            IControlCharUtil controlCharUtil,
            IProtectedOperations protectedOperations)
        {
            _vimBufferData           = vimBufferData;
            _textView                = (IWpfTextView)_vimBufferData.TextView;
            _selectionUtil           = _vimBufferData.SelectionUtil;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged              += OnCaretEvent;
            _textView.GotAggregateFocus          += OnCaretEvent;
            _textView.LostAggregateFocus         += OnCaretEvent;
            _textView.Selection.SelectionChanged += OnCaretPositionOrSelectionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService = formatMapService;
     _controlCharUtil = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Beispiel #4
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView                = textView;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged         += OnCaretEvent;
            _textView.GotAggregateFocus     += OnCaretEvent;
            _textView.LostAggregateFocus    += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            var caretBlinkTime     = GetCaretBlinkTime();
            var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? Int32.MaxValue);

            _blinkTimer = new DispatcherTimer(
                caretBlinkTimeSpan,
                DispatcherPriority.Normal,
                _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer),
                Dispatcher.CurrentDispatcher);
            _blinkTimer.IsEnabled = caretBlinkTime != null;
        }
 internal CharDisplayTaggerSourceFactory(IVim vim, IEditorFormatMapService editorFormatMapService, IControlCharUtil controlCharUtil, IClassificationFormatMapService classificationFormatMapService)
 {
     _editorFormatMapService = editorFormatMapService;
     _vim             = vim;
     _controlCharUtil = controlCharUtil;
     _classificationFormatMapService = classificationFormatMapService;
 }
 protected virtual void Create(params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _controlCharUtil = new ControlCharUtil();
     _source = new CharDisplayTaggerSource(_textView, new Mock<IEditorFormatMap>(MockBehavior.Loose).Object, _controlCharUtil);
     _basicTaggerSource = _source;
 }
Beispiel #7
0
 protected virtual void Create(params string[] lines)
 {
     _textView          = CreateTextView(lines);
     _textBuffer        = _textView.TextBuffer;
     _controlCharUtil   = new ControlCharUtil();
     _source            = new CharDisplayTaggerSource(_textView, new Mock <IEditorFormatMap>(MockBehavior.Loose).Object, _controlCharUtil);
     _basicTaggerSource = _source;
 }
Beispiel #8
0
            public SettingsSync(IVimApplicationSettings vimApplicationSettings, IMarkDisplayUtil markDisplayUtil, IControlCharUtil controlCharUtil)
            {
                VimApplicationSettings = vimApplicationSettings;
                MarkDisplayUtil        = markDisplayUtil;
                ControlCharUtil        = controlCharUtil;

                MarkDisplayUtil.HideMarksChanged           += SyncToApplicationSettings;
                ControlCharUtil.DisplayControlCharsChanged += SyncToApplicationSettings;
                VimApplicationSettings.SettingsChanged     += SyncFromApplicationSettings;
            }
        internal CharDisplayTaggerSource(ITextView textView, IEditorFormatMap editorFormatMap, IControlCharUtil controlCharUtil)
        {
            _textView        = textView;
            _editorFormatMap = editorFormatMap;
            _controlCharUtil = controlCharUtil;
            UpdateBrushes();

            _textView.TextBuffer.Changed                += OnTextBufferChanged;
            _editorFormatMap.FormatMappingChanged       += OnFormatMappingChanged;
            _controlCharUtil.DisplayControlCharsChanged += OnSettingChanged;
        }
Beispiel #10
0
 internal BlockCaret(
     IWpfTextView textView,
     string adornmentLayerName,
     IClassificationFormatMap classificationFormatMap,
     IEditorFormatMap formatMap,
     IControlCharUtil controlCharUtil,
     IProtectedOperations protectedOperations) :
     this(
         textView,
         classificationFormatMap,
         formatMap,
         textView.GetAdornmentLayer(adornmentLayerName),
         controlCharUtil,
         protectedOperations)
 {
 }
Beispiel #11
0
 internal BlockCaret(
     IVimBufferData vimBufferData,
     string adornmentLayerName,
     IClassificationFormatMap classificationFormatMap,
     IEditorFormatMap formatMap,
     IControlCharUtil controlCharUtil,
     IProtectedOperations protectedOperations) :
     this(
         vimBufferData,
         classificationFormatMap,
         formatMap,
         (vimBufferData.TextView as IWpfTextView).GetAdornmentLayer(adornmentLayerName),
         controlCharUtil,
         protectedOperations)
 {
 }
Beispiel #12
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView                = textView;
            _editorFormatMap         = formatMap;
            _adornmentLayer          = layer;
            _protectedOperations     = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil         = controlCharUtil;

            _textView.LayoutChanged         += OnCaretEvent;
            _textView.GotAggregateFocus     += OnCaretEvent;
            _textView.LostAggregateFocus    += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
        protected virtual void Create(params string[] lines)
        {
            _textView                = CreateTextView(lines);
            _textBuffer              = _textView.TextBuffer;
            _controlCharUtil         = new ControlCharUtil();
            _classificationFormatMap = new Mock <IClassificationFormatMap>(MockBehavior.Strict);
            var typeface = SystemFonts.CaptionFontFamily.GetTypefaces().First();
            var textFormattingProperties = TextFormattingRunProperties.CreateTextFormattingRunProperties(typeface, 10.0, Colors.Black);

            _classificationFormatMap.SetupGet(x => x.DefaultTextProperties).Returns(textFormattingProperties);
            _source = new CharDisplayTaggerSource(
                _textView,
                new Mock <IEditorFormatMap>(MockBehavior.Loose).Object,
                _controlCharUtil,
                _classificationFormatMap.Object);
            _basicTaggerSource = _source;
        }
Beispiel #14
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView = textView;
            _editorFormatMap = formatMap;
            _adornmentLayer = layer;
            _protectedOperations = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil = controlCharUtil;

            _textView.LayoutChanged += OnCaretEvent;
            _textView.GotAggregateFocus += OnCaretEvent;
            _textView.LostAggregateFocus += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer);
        }
Beispiel #15
0
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            IExtensionAdapterBroker extensionAdapterBroker,
            IProtectedOperations protectedOperations,
            IMarkDisplayUtil markDisplayUtil,
            IControlCharUtil controlCharUtil,
            ICommandDispatcher commandDispatcher,
            SVsServiceProvider serviceProvider,
            IClipboardDevice clipboardDevice)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte                     = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility         = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager             = textManager;
            _sharedService           = sharedServiceFactory.Create();
            _vsMonitorSelection      = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>();
            _vimApplicationSettings  = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;
            _extensionAdapterBroker  = extensionAdapterBroker;
            _runningDocumentTable    = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _vsShell                 = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _protectedOperations     = protectedOperations;
            _commandDispatcher       = commandDispatcher;
            _clipboardDevice         = clipboardDevice;

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie);
            _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie);

            InitOutputPane();

            _settingsSync = new SettingsSync(vimApplicationSettings, markDisplayUtil, controlCharUtil, _clipboardDevice);
            _settingsSync.SyncFromApplicationSettings();
        }
Beispiel #16
0
        internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations)
        {
            _textView = textView;
            _editorFormatMap = formatMap;
            _adornmentLayer = layer;
            _protectedOperations = protectedOperations;
            _classificationFormatMap = classificationFormatMap;
            _controlCharUtil = controlCharUtil;

            _textView.LayoutChanged += OnCaretEvent;
            _textView.GotAggregateFocus += OnCaretEvent;
            _textView.LostAggregateFocus += OnCaretEvent;
            _textView.Caret.PositionChanged += OnCaretPositionChanged;
            _textView.Closed += OnTextViewClosed;

            var caretBlinkTime = GetCaretBlinkTime();
            var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? Int32.MaxValue);
            _blinkTimer = new DispatcherTimer(
                caretBlinkTimeSpan,
                DispatcherPriority.Normal,
                _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer),
                Dispatcher.CurrentDispatcher);
            _blinkTimer.IsEnabled = caretBlinkTime != null;
        }
Beispiel #17
0
 internal CharDisplayTaggerSourceFactory(IVim vim, IEditorFormatMapService editorFormatMapService, IControlCharUtil controlCharUtil)
 {
     _editorFormatMapService = editorFormatMapService;
     _vim             = vim;
     _controlCharUtil = controlCharUtil;
 }
Beispiel #18
0
 internal BlockCaret(IWpfTextView textView, string adornmentLayerName, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) :
     this(textView, classificationFormatMap, formatMap, textView.GetAdornmentLayer(adornmentLayerName), controlCharUtil, protectedOperations)
 {
 }