1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-02 23:21:15 +03:00
This commit is contained in:
Maxime Coste 2019-04-29 09:30:31 +04:00
commit 92972bed4f

View File

@ -25,10 +25,10 @@ declare-option -hidden line-specs git_diff_flags
define-command -params 1.. \
-docstring %sh{printf 'git [<arguments>]: git wrapping helper
All the optional arguments are forwarded to the git utility
Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n hide-diff\n log\n show\n show-diff\n status\n update-diff'} \
Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n hide-diff\n \init\n log\n show\n show-diff\n status\n update-diff'} \
-shell-script-candidates %{
if [ $kak_token_to_complete -eq 0 ]; then
printf "add\nrm\nblame\ncommit\ncheckout\ndiff\nhide-blame\nhide-diff\nlog\nshow\nshow-diff\nstatus\nupdate-diff\n"
printf "add\nrm\nblame\ncommit\ncheckout\ndiff\nhide-blame\nhide-diff\nlog\nshow\nshow-diff\ninit\nstatus\nupdate-diff\n"
else
case "$1" in
commit) printf -- "--amend\n--no-edit\n--all\n--reset-author\n--fixup\n--squash\n"; git ls-files -m ;;
@ -145,6 +145,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
'
}
commit() {
# Handle case where message needs not to be edited
if grep -E -q -e "-m|-F|-C|--message=.*|--file=.*|--reuse-message=.*|--no-edit|--fixup.*|--squash.*"; then
@ -189,6 +190,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
;;
update-diff) update_diff ;;
commit) shift; commit "$@" ;;
init) shift; git init "$@" > /dev/null 2>&1 ;;
checkout)
name="${2:-${kak_buffile}}"
git checkout "${name}" > /dev/null 2>&1