2825ca5f73
adds the ability to press <ret> within a hunk and navigate to the original source code. This can be useful because one often needs to go back and forth between the diff and the full source code. - You can press <ret> anywhere _within_ a hunk i.e. lines that start with ` `, `+`, `-`. You will be taken to the exact line in the source that corresponds to where you pressed <ret> in the hunk. It actually does not make sense to press <ret> on a `-` line because that does not exist anymore but in that case you are taken to a nearby line in the hope this is still useful. - You can also press <ret> on a range line (lines that look like @@ ... @@). If you press <ret> on anywhere on a range line e.g. ``` @@ -120,3 +123,4 @@ fn some_function { ``` The code will try to navigate to the section heading "fn some_function {" Note that the section heading is _not_ necessarily located at the range line (in the above example the range line is 123). - You can press <ret> on a +++ line also and you will be taken the first line of the file Caveats: - Navigation to the original source file will be accurate only if any edits to the original source file have been saved to disk, because otherwise they will not be detected by the `:git diff` or `:git show` commands - This feature should work well for most typical uses e.g. `:git diff`, `:git diff HEAD^` `:git diff <some-sha1>`. In fact this feature should work in all scenarios when the *current files* on disk are being compared _with_ some arbitrary git revision/staging. It will be less useful in other scenarios when two arbitrary revisions are being compared to each other or when you are trying to compare staging to some revision. For example when you invoke `:git diff --staged` you are trying to compare staging with HEAD but are navigating to what is currently on disk (which may be different from staging). Co-authored-by: Johannes Altmanninger <aclopte@gmail.com> |
||
---|---|---|
.. | ||
go | ||
python | ||
rust | ||
autorestore.asciidoc | ||
autorestore.kak | ||
autowrap.kak | ||
clang.kak | ||
comment.kak | ||
ctags.kak | ||
doc.asciidoc | ||
doc.kak | ||
format.kak | ||
git.kak | ||
grep.kak | ||
lint.asciidoc | ||
lint.kak | ||
make.kak | ||
man.kak | ||
spell.kak |