1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 03:56:32 +03:00

git-tools.kak: support add and diff command

This commit is contained in:
Maxime Coste 2013-04-25 18:52:06 +02:00
parent 8bfe2d62e5
commit 70d65dac79

View File

@ -17,7 +17,7 @@ def -shell-params git %{ %sh{
show_git_cmd_output() {
local filetype
case "$1" in
show) filetype=diff ;;
show|diff) filetype=diff ;;
log) filetype=git-log ;;
esac
tmpfile=$(mktemp /tmp/kak-git-XXXXXX)
@ -89,13 +89,21 @@ def -shell-params git %{ %sh{
}
case "$1" in
show|log) show_git_cmd_output "$@" ;;
show|log|diff) show_git_cmd_output "$@" ;;
blame) run_git_blame ;;
show-diff)
echo "try %{ addhl flag_lines black git_diff_flags } catch %{}"
update_diff
;;
update-diff) update_diff ;;
add)
name="${2:-${kak_bufname}}"
if git add -- "${name}"; then
echo "echo -color Information 'git: added ${name}'"
else
echo "echo -color Error 'git: unable to add ${name}'"
fi
;;
*) echo "echo %{unknown git command '$1'}"; exit ;;
esac