feat(worktree): harpoon now works well with worktrees

This commit is contained in:
ThePrimeagen 2021-04-07 14:42:36 -06:00
parent 44810f677d
commit 4548a7a3c9
3 changed files with 5 additions and 5 deletions

View File

@ -85,6 +85,8 @@ local function ensure_correct_config(config)
marks[idx].filename = utils.normalize_path(mark.filename)
end
return config
end
local function expand_dir(config)
@ -141,11 +143,11 @@ M.setup = function(config)
end
M.get_term_config = function()
return HarpoonConfig.projects[vim.loop.cwd()].term
return ensure_correct_config(HarpoonConfig).projects[vim.loop.cwd()].term
end
M.get_mark_config = function()
return HarpoonConfig.projects[vim.loop.cwd()].mark
return ensure_correct_config(HarpoonConfig).projects[vim.loop.cwd()].mark
end
M.get_menu_config = function()

View File

@ -259,8 +259,6 @@ M.toggle_file = function(file_name_or_buf_id)
end
end
M.to_quickfix_list()
M.get_current_index = function()
return M.get_index_of(vim.fn.bufname(vim.fn.bufnr()))
end

View File

@ -95,7 +95,7 @@ M.nav_file = function(id)
end
local mark = Marked.get_marked_file(idx)
local buf_id = vim.fn.bufnr(mark.filename)
local buf_id = vim.fn.bufnr(mark.filename, true)
local set_row = not vim.api.nvim_buf_is_loaded(buf_id)
vim.api.nvim_set_current_buf(buf_id)