Ejemplo n.º 1
0
        public void RemoveBuffer2()
        {
            var view      = CreateTextView("foo bar");
            var vimBuffer = _vim.CreateVimBuffer(view);

            Assert.True(_vim.RemoveVimBuffer(view));
            Assert.True(_vim.GetVimBuffer(view).IsNone());
        }
Ejemplo n.º 2
0
        public void CloseAllVimBuffers_Multiple()
        {
            const int count = 5;

            for (var i = 0; i < count; i++)
            {
                _vim.CreateVimBuffer(CreateTextView(""));
            }

            Assert.Equal(count, _vim.VimBuffers.Length);
            _vim.CloseAllVimBuffers();
            Assert.Equal(0, _vim.VimBuffers.Length);
        }
Ejemplo n.º 3
0
 private CommandKeyBindingSnapshot GetCommandKeyBindingSnapshot(IVim vim, IKeyBindingService keyBindingService)
 {
     var textView = vim.VimHost.CreateHiddenTextView();
     try
     {
         var vimBuffer = vim.CreateVimBuffer(textView);
         return keyBindingService.CreateCommandKeyBindingSnapshot(vimBuffer);
     }
     finally
     {
         textView.Close();
     }
 }
Ejemplo n.º 4
0
 private CommandKeyBindingSnapshot GetCommandKeyBindingSnapshot(IVim vim, IKeyBindingService keyBindingService)
 {
     var textView = vim.VimHost.CreateHiddenTextView();
     try
     {
         var vimBuffer = vim.CreateVimBuffer(textView);
         return keyBindingService.CreateCommandKeyBindingSnapshot(vimBuffer);
     }
     finally
     {
         textView.Close();
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Create an IVimBuffer instance with the given lines
        /// </summary>
        protected IVimBuffer CreateVimBuffer(params string[] lines)
        {
            var textView = CreateTextView(lines);

            return(_vim.CreateVimBuffer(textView));
        }