nvim: autoload: git: Use bwipeout instead of bdelete
Really delete the buffer. If bdelete is used, we can still go back to the previous buffer using <C-^> which we do not want. Basically we do not want a fugitive git buffer to become alternate-file. See :help alternate-file.
This commit is contained in:
parent
8694445d2d
commit
a9c91c06e4
1 changed files with 5 additions and 5 deletions
|
@ -17,7 +17,7 @@ function! git#git_branch_delete() abort
|
||||||
execute "Git push -d " . remote . " " . branch
|
execute "Git push -d " . remote . " " . branch
|
||||||
execute "Git branch -D " . branch
|
execute "Git branch -D " . branch
|
||||||
endif
|
endif
|
||||||
silent execute "bd"
|
silent execute "bw"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Checkout the branch on the current line in the output of Git branch -a.
|
" 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 " . remote
|
||||||
silent execute "Git checkout -b " . branch[2]
|
silent execute "Git checkout -b " . branch[2]
|
||||||
endif
|
endif
|
||||||
silent execute "bd"
|
silent execute "bw"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Get the log of the branch on current line in the output of Git branch -a.
|
" 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 line = trim(getline('.'))
|
||||||
let branch = split(line, "/")
|
let branch = split(line, "/")
|
||||||
" Close the buffer opened by Git branch -a
|
" Close the buffer opened by Git branch -a
|
||||||
silent execute "bd"
|
silent execute "bw"
|
||||||
if len(branch) == 1
|
if len(branch) == 1
|
||||||
" Handles the case for local branch
|
" Handles the case for local branch
|
||||||
execute "Git log " . branch[0]
|
execute "Git log " . branch[0]
|
||||||
|
@ -59,7 +59,7 @@ function! git#git_branch_log_pretty() abort
|
||||||
let line = trim(getline('.'))
|
let line = trim(getline('.'))
|
||||||
let branch = split(line, "/")
|
let branch = split(line, "/")
|
||||||
" Close the buffer opened by Git branch -a
|
" Close the buffer opened by Git branch -a
|
||||||
silent execute "bd"
|
silent execute "bw"
|
||||||
if len(branch) == 1
|
if len(branch) == 1
|
||||||
" Handles the case for local branch
|
" Handles the case for local branch
|
||||||
execute "Git log --pretty=oneline --no-merges " . branch[0]
|
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 oldCommit = split(lines[0], " ")[:0][0]
|
||||||
let newCommit = split(lines[-1], " ")[:0][0]
|
let newCommit = split(lines[-1], " ")[:0][0]
|
||||||
execute "Git cherry-pick " . oldCommit . "^.." . newCommit
|
execute "Git cherry-pick " . oldCommit . "^.." . newCommit
|
||||||
silent execute "bd"
|
silent execute "bw"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Run Git difftool on the commit in the line which we are at. To be used after
|
" Run Git difftool on the commit in the line which we are at. To be used after
|
||||||
|
|
Loading…
Reference in a new issue