mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 10:00:29 +00:00
fix: vertical and horizontal split
This commit is contained in:
parent
ac9cbed9ed
commit
1d7ea57575
@ -76,6 +76,7 @@ function M.get_default_config()
|
|||||||
|
|
||||||
---@param file_item HarpoonListFileItem
|
---@param file_item HarpoonListFileItem
|
||||||
select = function(file_item, options)
|
select = function(file_item, options)
|
||||||
|
options = options or {}
|
||||||
if file_item == nil then
|
if file_item == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -87,14 +88,14 @@ function M.get_default_config()
|
|||||||
bufnr = vim.fn.bufnr(file_item.value, true)
|
bufnr = vim.fn.bufnr(file_item.value, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not options or not options.vsplit or not options.split then
|
if options.vsplit then
|
||||||
vim.api.nvim_set_current_buf(bufnr)
|
|
||||||
elseif options.vsplit then
|
|
||||||
vim.cmd("vsplit")
|
vim.cmd("vsplit")
|
||||||
vim.api.nvim_set_current_buf(bufnr)
|
vim.api.nvim_set_current_buf(bufnr)
|
||||||
elseif options.split then
|
elseif options.split then
|
||||||
vim.cmd("split")
|
vim.cmd("split")
|
||||||
vim.api.nvim_set_current_buf(bufnr)
|
vim.api.nvim_set_current_buf(bufnr)
|
||||||
|
else
|
||||||
|
vim.api.nvim_set_current_buf(bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
if set_position then
|
if set_position then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user