fix: add opts.bufnr and opts.winnr to builtin picker (#1706)

This commit is contained in:
James Trew
2022-02-14 11:39:58 -05:00
committed by GitHub
parent c948263d89
commit 206e71d133
8 changed files with 39 additions and 56 deletions

View File

@@ -101,8 +101,8 @@ local get_current_buf_line = function(winnr)
end
git.bcommits = function(opts)
opts.current_line = (opts.current_file == nil) and get_current_buf_line(0) or nil
opts.current_file = vim.F.if_nil(opts.current_file, vim.fn.expand "%:p")
opts.current_line = (opts.current_file == nil) and get_current_buf_line(opts.winnr) or nil
opts.current_file = vim.F.if_nil(opts.current_file, vim.api.nvim_buf_get_name(opts.bufnr))
opts.entry_maker = vim.F.if_nil(opts.entry_maker, make_entry.gen_from_git_commits(opts))
local git_command = vim.F.if_nil(opts.git_command, { "git", "log", "--pretty=oneline", "--abbrev-commit" })