home/rc/tools
Johannes Altmanninger bf239ba77a rc diff: introduce diff-jump, replacing git-diff-goto-source
git-diff-goto-source is specific to diffs produced by Git.  This patch
generalizes the logic and moves it to a new diff-jump in diff.kak.

The main differences are:
- diff-jump handles plain file diffs (i.e. without the -r option). These
  have no "diff" line. This means that it needs to parse +++/--- instead.
- diff-jump can go to the old file, not just the new one.
- diff-jump allows to override the base directory and the number of
  directory components to strip.

git-diff-goto-source was implemented with several nested try/catch
blocks.  Implementing the extra features would have added more
nesting, redundancy or hidden options. To avoid that, I ported the
parsing logic to Perl (which git.kak already depends on). Maybe
it's possible to do the same in awk.

Potential concerns:
- We could move diff-jump to a new rc/tools/diff.kak but then it's not
  obvious where the "diff" module belongs to.
- Should diff "diff-jump -1" be spelled "diff-jump -p1"?

In future, the diff parser could be reused to implement a vimdiff-style
feature: given a diff and the "old" line number, we can compute the
corresponding "new" line number. Perhaps diff-jump should get a -client
argument.
2022-01-25 14:15:01 +01:00
..
go gopls.kak: use nop for removing temp dir 2020-10-17 09:47:07 +02: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 Reference content goes in docstrings, explanations go in prose docs. 2020-09-04 19:20:50 +10:00
autowrap.kak rc: Make docstrings more readable 2020-02-03 20:53:28 +01:00
clang.kak Replace write -atomic with write -method <method> 2020-10-27 20:20:18 +11:00
comment.kak Disable comment_line for ocaml/coq 2021-10-04 13:19:00 -04:00
ctags.kak Merge remote-tracking branch 'lenormf/patch-3' 2020-02-05 20:41:40 +11:00
doc.asciidoc Update plugin docs to not duplicate docstring information. 2020-09-03 17:18:19 +10:00
doc.kak rc doc: Don't spawn processes unecessarily 2021-09-16 11:47:44 +03:00
format.kak rc: Consistently use a dot as template separator 2020-11-30 14:24:06 +03:00
git.kak rc diff: introduce diff-jump, replacing git-diff-goto-source 2022-01-25 14:15:01 +01:00
grep.kak Apply suggestions from code review 2020-09-06 10:56:37 +10: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/tools/make.kak: quote "${kak_opt_makecmd}" 2021-11-05 13:43:18 -03:00
man.kak rc man: Gracefully fail link search 2021-11-04 07:31:43 +03:00
spell.kak Add standard DiagnosticError and DiagnosticWarning faces. 2021-09-07 17:46:50 +10:00