public void RemoveBuffer2() { var view = CreateTextView("foo bar"); var vimBuffer = _vim.CreateVimBuffer(view); Assert.True(_vim.RemoveVimBuffer(view)); Assert.True(_vim.GetVimBuffer(view).IsNone()); }
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); }
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(); } }
/// <summary> /// Create an IVimBuffer instance with the given lines /// </summary> protected IVimBuffer CreateVimBuffer(params string[] lines) { var textView = CreateTextView(lines); return(_vim.CreateVimBuffer(textView)); }