rc diff: bind diff-jump in all filetype=diff buffers, not just *.diff or *.patch files

Mapping in the filetype hook matches others like grep.kak and man.kak.
Since we map in buffer scope, git diff buffers will override diff-jump
with git-diff-goto-source.

This means that the diff-jump binding applies here:

	diff -u "$1" "$2" | kak -e 'set buffer filetype diff'

Reported in: https://github.com/mawww/kakoune/issues/153#issuecomment-1030643854
This commit is contained in:
Johannes Altmanninger 2022-02-05 19:34:49 +01:00
parent 1c2e1e1090
commit 49de2b91c4

View File

@ -1,10 +1,10 @@
hook global BufCreate .*\.(diff|patch) %{
set-option buffer filetype diff
map buffer normal <ret> %{: diff-jump<ret>}
}
hook global WinSetOption filetype=diff %{
require-module diff
map buffer normal <ret> %{: diff-jump<ret>}
}
hook -group diff-highlight global WinSetOption filetype=diff %{