| Age | Commit message (Collapse) | Author |
|
With `interactive.diffFilter = delta --color-only` delta is called
by e.g. `git add -p`, but in this mode git hides the terminal from
the pager.
Plus/minus lines correctly use ANSI sequences to paint up to to the
end of the line, but zero lines always use spaces. This needs the terminal
width, but it is not available for diffFilter. So the fallback
of 80 is used, and zero styles did not extend to the full terminal width.
Since zero lines are only rarely styled (e.g. via
`--zero-style='syntax "#1d1f21" dim'`), this was never noticed.
This also crashed delta when a zero line was longer than 80.
|
|
Output can be generated directly via Painter::write, or Painter::output_buffer.
The latter must be emit()'ed before the former method can be used again,
otherwise the order is incorrect.
Tests added. Fixes #1504
|
|
|
|
|
|
|
|
|
|
take() and pass it to BufReader so it gets closed when the reader stops.
Otherwise on an early pager (EPIPE), and thus delta() exit the feeding
subcommand still has an open stdout to write something into and
wait()-ing on it hangs.
|
|
* Support external subcommands: rg, git show, git log (etc.)
The possible command line now is:
delta <delta-args> [SUBCMD <subcmd-args>]
If the entire command line fails to parse because SUBCMD is unknown,
then try (until the next arg fails) parsing <delta-args> only,
and then parse and call SUBCMD.., its output is piped into delta.
Other subcommands also take precedence over the diff/git-diff mode
(`delta a b`, where e.g. a=git and b=show), and any diff call gets
converted into an external subcommand first.
Available are:
delta rg .. => rg --json .. | delta
delta a b .. => git diff a b .. | delta
delta git show .. => git <color-on> show .. | delta
and all other git-CMDS, of which
add -p, blame, checkout -p, diff, grep, log -p, reflog -p, and stash show -p
produce a diff.
Because --json is automatically added for `delta rg ..`, it avoids the
parsing ambiguities of and is easier to type than `rg .. | delta`.
The piping is not done by the shell, but delta, so the subcommands
are now child processes of delta.
* Set calling process directly because delta started it
This info then takes precedence over whatever
start_determining_calling_process_in_thread() finds or rather
doesn't find.
(The simple yet generous SeqCst is used on purpose for the atomic operations.)
|
|
But now < 1.83 clippy would complain about an unknown lint, so
allow that, too.
|
|
|
|
|
|
Previously only the last commit was linked.
Do not link numbers (technically also commits), and stop after
finding 12 commits on a line.
|
|
|
|
* Support {host} in hyperlinks
* Improve help text
|
|
|
|
|
|
Redundant Option Checks, unwrap Safety, unnecessary Lifetimes, Rust often infers lifetimes automatically
---------
Co-authored-by: Quied <dexflame3@gmail.com>
|
|
The output and exit code of run_app() are now testable, used for diff test.
|
|
|
|
Move blame to CallingProcess
Signed-off-by: dvermd <315743+dvermd@users.noreply.github.com>
|
|
Signed-off-by: dvermd <315743+dvermd@users.noreply.github.com>
|
|
|
|
The fallback is already handled in `set_options`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Fix non-portable doc comments warning
A line starting with > might be interpreted as a block quote.
In regular markdown this could be prevented by escaping the `>`
using a backslash. However, since the doc comments are used by
clap for the long help more or less verbatim, the `\` would be visible
hence the shuffling around of words.
* Use `.contains()`
|
|
When core.quotepath is true (the default) then non-ASCII chars
in a file name are quoted. These quotes hide the DIFF_PREFIXES and
"a/1" "b/1" remains as such, instead of becoming "1" "1".
This was interpreted by delta as renamed file. Now these quotes are
removed before the DIFF_PREFIXES are searched.
|
|
|
|
|
|
|
|
`diff -u file1 file2` output starts with '--- file1', a '-- 12' line
being removed results in '--- 12', which was interpreted as the start of
a new diff. Now the number of removed lines announced in the header as e.g.
'@@ -1,4 +1,3 @@' is taken into account for this specific diff input.
|
|
Adds --diff-args with short form -@.
|
|
|
|
Upgrade "time" (and its dependency chain rooted at "plist"), the previous
version did not build with 1.80.
Tell the new 'unexpected_cfgs' lint that 'tarpaulin_include' is okay
Mark one clippy lint as a false positive
|
|
|
|
Tell clap to not wrap output, append `after_long_help()` (with matching
ansi codes in this section), then manually wrap the result.
The help output is now paginated if writing to a terminal.
All code paths flow back to main(), so an invoked pager is properly
waited for (by the OutputType drop impl).
|
|
Unicode and somewhat ANSI aware, can add indentation (skippable) and
can also skip wrapping lines by using configurable magic prefixes.
|
|
|
|
Use new, smaller PagerCfg instead of the full Config, as for
pager output only 3 variables are relevant.
oneshot_write() can be used to write paginated output, usually
before exiting.
|
|
--max-line-length increased to 3000, highlighting now stops after 400
characters. In that case the highlighting may be incorrect until it
is reset for the next hunk.
|
|
Document that the input of `truncate_str()` may be cut on a double width
char ("fullwidth") - then the output is no longer a prefix of the input.
`truncate_str_short()` could be faster by not constructing the result and
instead only returning an index, but it will be used in rare edge cases so
reusing existing logic is good enough.
Common code moved to `truncate_str_impl()`.
Assume (with fallback) that graphemes are at most 2 wide.
Fewer allocations.
Tests.
|
|
|