From 1d7ea5757589714db56d0fd7dc050ce0d77606d3 Mon Sep 17 00:00:00 2001 From: mpaulson Date: Thu, 30 Nov 2023 14:24:43 -0700 Subject: [PATCH] fix: vertical and horizontal split --- lua/harpoon2/config.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/harpoon2/config.lua b/lua/harpoon2/config.lua index 816eb2d..daaf028 100644 --- a/lua/harpoon2/config.lua +++ b/lua/harpoon2/config.lua @@ -76,6 +76,7 @@ function M.get_default_config() ---@param file_item HarpoonListFileItem select = function(file_item, options) + options = options or {} if file_item == nil then return end @@ -87,14 +88,14 @@ function M.get_default_config() bufnr = vim.fn.bufnr(file_item.value, true) end - if not options or not options.vsplit or not options.split then - vim.api.nvim_set_current_buf(bufnr) - elseif options.vsplit then + if options.vsplit then vim.cmd("vsplit") vim.api.nvim_set_current_buf(bufnr) elseif options.split then vim.cmd("split") vim.api.nvim_set_current_buf(bufnr) + else + vim.api.nvim_set_current_buf(bufnr) end if set_position then