Exemplo n.º 1
0
            public void GetOrCreateVimBufferForHost_Disallow()
            {
                VimHost.ShouldCreateVimBufferImpl = false;
                var textView = CreateTextView("");

                Assert.False(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer));
            }
Exemplo n.º 2
0
            public void GetOrCreateVimBufferForHost_Simple()
            {
                VimHost.ShouldCreateVimBufferImpl = true;
                var textView = CreateTextView("");

                Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer));
                Assert.NotNull(vimBuffer);
            }
Exemplo n.º 3
0
            public void GetOrCreateVimBufferForHost_AlreadyCreated()
            {
                VimHost.ShouldCreateVimBufferImpl = false;
                var textView = CreateTextView("");

                Vim.CreateVimBuffer(textView);

                Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer));
                Assert.NotNull(vimBuffer);
            }
Exemplo n.º 4
0
            public void GetOrCreateVimBufferForHost_VimTextBufferAlreadyCreated()
            {
                VimHost.ShouldCreateVimBufferImpl = true;

                var textView      = CreateTextView("");
                var vimTextBuffer = Vim.GetOrCreateVimTextBuffer(textView.TextBuffer);

                Assert.True(Vim.TryGetOrCreateVimBufferForHost(textView, out IVimBuffer vimBuffer));
                Assert.Same(textView, vimBuffer.TextView);
                Assert.Same(vimTextBuffer, vimBuffer.VimTextBuffer);
            }