diff --git a/nvim/.config/nvim/autoload/git.vim b/nvim/.config/nvim/autoload/git.vim index 820c156..6c7f323 100644 --- a/nvim/.config/nvim/autoload/git.vim +++ b/nvim/.config/nvim/autoload/git.vim @@ -17,7 +17,7 @@ function! git#git_branch_delete() abort execute "Git push -d " . remote . " " . branch execute "Git branch -D " . branch endif - silent execute "bd" + silent execute "bw" endfunction " Checkout the branch on the current line in the output of Git branch -a. @@ -33,7 +33,7 @@ function! git#git_branch_checkout() abort silent execute "Git checkout " . remote silent execute "Git checkout -b " . branch[2] endif - silent execute "bd" + silent execute "bw" endfunction " Get the log of the branch on current line in the output of Git branch -a. @@ -41,7 +41,7 @@ function! git#git_branch_log() abort let line = trim(getline('.')) let branch = split(line, "/") " Close the buffer opened by Git branch -a - silent execute "bd" + silent execute "bw" if len(branch) == 1 " Handles the case for local branch execute "Git log " . branch[0] @@ -59,7 +59,7 @@ function! git#git_branch_log_pretty() abort let line = trim(getline('.')) let branch = split(line, "/") " Close the buffer opened by Git branch -a - silent execute "bd" + silent execute "bw" if len(branch) == 1 " Handles the case for local branch execute "Git log --pretty=oneline --no-merges " . branch[0] @@ -91,7 +91,7 @@ function! git#git_cherry_pick_range() abort let oldCommit = split(lines[0], " ")[:0][0] let newCommit = split(lines[-1], " ")[:0][0] execute "Git cherry-pick " . oldCommit . "^.." . newCommit - silent execute "bd" + silent execute "bw" endfunction " Run Git difftool on the commit in the line which we are at. To be used after