Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix and branch name as default for worktree path #31

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lua/telescope/_extensions/git_worktree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ end
-- Create a prompt to get the path of the new worktree
-- @param cb function: the callback to call with the path
-- @return nil
local create_input_prompt = function(cb)
local subtree = vim.fn.input('Path to subtree > ')
local create_input_prompt = function(cb, name, prefix)
prefix = prefix or ''
local subtree = vim.fn.input('Path to subtree > ', prefix .. name)
cb(subtree)
end

Expand All @@ -134,7 +135,7 @@ local create_worktree = function(opts)
name = branch
end
git_worktree.create_worktree(name, branch)
end)
end, branch, opts.prefix)
end)

return true
Expand Down