Skip to content

Commit

Permalink
fix new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Nov 12, 2023
1 parent 618b6c9 commit 0905d88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .config/nvim/lua/plugins/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ endfunction
-------------------------
-- Create a new branch --
-------------------------
local new_branch = function(branch_opts)
function _G.create_new_branch(branch_opts)
if branch_opts.args ~= '' then
return vim.cmd('Git checkout -b ' .. branch_opts.args)
end
Expand All @@ -191,7 +191,7 @@ endfunction
vim.cmd('Git checkout -b ' .. input)
end)
end
vim.api.nvim_create_user_command('Gcb', new_branch, { nargs = '?' })
vim.api.nvim_create_user_command('Gcb', _G.create_new_branch, { nargs = '?' })
nmap('<leader>gb', '<cmd>call append(".",FugitiveHead())<cr>')
-- redir @">|silent scriptnames|redir END|enew|put

Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/lua/user/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ M.git = {
require('user.git-branches').open()
end,
['Checkout new branch (:Gcb {new_branch})'] = function()
new_branch { args = '' }
_G.create_new_branch { args = '' }
end,
['Work in Progress commit (on git window - wip)'] = function()
vim.cmd 'call Enter_Wip_Moshe()'
Expand Down

0 comments on commit 0905d88

Please sign in to comment.