kakoune/rc/tools
Johannes Altmanninger d6b75ac0bb rc tools git: change git diff filetype from diff to git-diff
Diff buffers created by ":git diff" differ from other filetype=diff
buffers in that they use "git rev-parse --show-toplevel" as root
directory for diff-jump. This makes sense because paths printed by
"git diff" are relative to that directory.

Today we handle the above difference by making ":git" override the
diff-jump mapping.  This doesn't work for buffers that were read from
a file.  Fix this by introducing a separate filetype, "git-diff",
which allows to move the mapping in the usual place.

This breaks existing filetype=diff hooks[1] which need to be adapted
to match git-diff (also git-log).

Another motivation for the separate filetype is that a following
patch wants to enable Git blame commands in git-diff buffers but
not in plain diff buffers -- those should keep being blamed like any
other file if tracked by Git.
Perhaps git-* buffers are for Git metadata, not files that are tracked
by Git.

The added hooks awkwardly include their hook parameter to work around
hook ordering issues when switching between filetypes. See also [2].

We could also use filetype=git-log instead of git-diff.
Our highlighting for "git log --graph" would have rare false positives.

Closes #5049

[1]: https://github.com/search?utf8=%E2%9C%93&q=filetype%3Ddiff+language%3Akakounescript+-repo%3Amawww%2Fkakoune+-is%3Afork&type=code
[2]: https://lists.sr.ht/~mawww/kakoune/%3C20240201091907.973508-1-aclopte@gmail.com%3E
2024-02-05 21:42:02 +11:00
..
go Adjust regex in gopls-def for when filepath contains a dash 2022-11-15 10:10:24 +01:00
python Fix jedi off-by-one and refactor jedi 2021-05-04 20:57:13 +02:00
rust simplify rust completion to match generic Kakoune completions 2019-05-17 20:00:40 +03:00
autorestore.asciidoc Update plugin docs to not duplicate docstring information. 2020-09-03 17:18:19 +10:00
autorestore.kak rc autorestore: fix regression due to ! breaking change 2022-04-28 19:32:24 +02:00
autowrap.kak Make x just select the full lines 2022-07-05 08:43:40 +10:00
clang.kak Move user mappings to <space> and keep/remove selection to , 2022-07-05 08:43:40 +10:00
comment.kak Update Pony language support 2024-01-11 23:46:14 +03:00
ctags.kak Remove sorting of tags results 2024-01-17 21:18:22 +11:00
doc.asciidoc Wrapped the lines at the 80th column 2022-05-06 10:33:12 -07:00
doc.kak ranked match: prefer input order over alphabetical order for user-specified completions 2023-12-02 10:43:59 +01:00
format.kak rc format: restore in-client error when formatcmd fails 2022-04-09 15:36:02 +02:00
git.kak rc tools git: change git diff filetype from diff to git-diff 2024-02-05 21:42:02 +11:00
grep.kak rc grep: include stderr in grep buffer 2023-11-12 11:59:11 +01:00
lint.asciidoc Reference content goes in docstrings, explanations go in prose docs. 2020-09-04 19:20:50 +10:00
lint.kak Fix #3957 2021-07-09 22:18:25 -03:00
make.kak rc/make.kak reuse make_error_pattern 2023-11-02 09:11:18 +08:00
man.kak rc tools ctags/man: rationalize sorting of completion candidates 2024-01-13 17:24:03 +01:00
menu.kak rc tools menu: add -on-abort switch 2023-11-20 20:47:22 +01:00
patch-range.pl rc tools patch: skip patch message signature, fixing diff application 2024-01-26 09:55:52 +11:00
patch.kak rc tools patch: figure out path to patch-range.pl without double-parsing 2024-02-01 20:41:01 +11:00
spell.kak fix a sed error on mac 2023-09-05 14:48:26 +08:00