コード例 #1
0
        /// <summary>
        /// Create a Visual Studio simulation with the specified set of lines
        /// </summary>
        private void CreateCore(bool simulateResharper, bool usePeekRole, params string[] lines)
        {
            if (usePeekRole)
            {
                _textBuffer = CreateTextBuffer(lines);
                _textView = TextEditorFactoryService.CreateTextView(
                    _textBuffer,
                    TextEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Document, PredefinedTextViewRoles.Editable, Constants.TextViewRoleEmbeddedPeekTextView));
            }
            else
            {
                _textView = CreateTextView(lines);
                _textBuffer = _textView.TextBuffer;
            }
            _vimBuffer = Vim.CreateVimBuffer(_textView);
            _bufferCoordinator = new VimBufferCoordinator(_vimBuffer);
            _vsSimulation = new VsSimulation(
                _bufferCoordinator,
                simulateResharper: simulateResharper,
                simulateStandardKeyMappings: false,
                editorOperationsFactoryService: EditorOperationsFactoryService,
                keyUtil: KeyUtil);

            VimHost.TryCustomProcessFunc = (textView, insertCommand) =>
                {
                    if (textView == _textView)
                    {
                        return _vsSimulation.VsCommandTarget.TryCustomProcess(insertCommand);
                    }

                    return false;
                };
        }
コード例 #2
0
ファイル: VsIntegrationTest.cs プロジェクト: kun-liu/VsVim
 /// <summary>
 /// Create a Visual Studio simulation with the specified set of lines
 /// </summary>
 private void CreateCore(bool simulateResharper, bool usePeekRole, params string[] lines)
 {
     if (usePeekRole)
     {
         _textBuffer = CreateTextBuffer(lines);
         _textView = TextEditorFactoryService.CreateTextView(
             _textBuffer,
             TextEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Document, PredefinedTextViewRoles.Editable, Constants.TextViewRoleEmbeddedPeekTextView));
     }
     else
     {
         _textView = CreateTextView(lines);
         _textBuffer = _textView.TextBuffer;
     }
     _vimBuffer = Vim.CreateVimBuffer(_textView);
     _bufferCoordinator = new VimBufferCoordinator(_vimBuffer);
     _vsSimulation = new VsSimulation(
         _bufferCoordinator,
         simulateResharper: simulateResharper,
         simulateStandardKeyMappings: false,
         editorOperationsFactoryService: EditorOperationsFactoryService,
         keyUtil: KeyUtil);
 }
コード例 #3
0
ファイル: VsSimulation.cs プロジェクト: wmchristie/VsVim
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
コード例 #4
0
ファイル: VsIntegrationTest.cs プロジェクト: ericbock/VsVim
 /// <summary>
 /// Create a Visual Studio simulation with the specified set of lines
 /// </summary>
 private void Create(bool simulateResharper, params string[] lines)
 {
     _textView = CreateTextView(lines);
     _textBuffer = _textView.TextBuffer;
     _vimBuffer = Vim.CreateVimBuffer(_textView);
     _bufferCoordinator = new VimBufferCoordinator(_vimBuffer);
     _simulation = new VsSimulation(
         _bufferCoordinator,
         simulateResharper: simulateResharper,
         simulateStandardKeyMappings: false,
         editorOperationsFactoryService: EditorOperationsFactoryService);
 }
コード例 #5
0
ファイル: VsSimulation.cs プロジェクト: RobertHu/VsVim
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
コード例 #6
0
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
コード例 #7
0
ファイル: VsSimulation.cs プロジェクト: zmarrapese/VsVim
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
コード例 #8
0
ファイル: VsIntegrationTest.cs プロジェクト: GunioRobot/VsVim
 /// <summary>
 /// Create a Visual Studio simulation with the specified set of lines
 /// </summary>
 private void Create(bool simulateResharper, params string[] lines)
 {
     _textView = CreateTextView(lines);
     _vimBuffer = Vim.CreateVimBuffer(_textView);
     _bufferCoordinator = new VimBufferCoordinator(_vimBuffer);
     _simulation = new VsSimulation(_bufferCoordinator, simulateResharper);
 }