| Age | Commit message (Collapse) | Author |
|
|
|
* 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.
|
|
The output and exit code of run_app() are now testable, used for diff test.
|
|
|
|
Adds --diff-args with short form -@.
|
|
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).
|
|
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.
|
|
* Fix unused variables
* Don't read git files when --no-gitconfig is given
Despite starting delta with `--no-gitconfig`, strace still shows
that `.git/config` etc. files are accessed. By no longer doing
that it is very clear that no config options are read from there.
|
|
* Fix clippy warnings
* Repair --default-language, and highlight using full filename
Fixed that the "txt" fallback was used instead of --default-language
And when looking for syntax highlighting, keep the filename around
as long as possible.
Using simple custom logic (filename > 4) a Makefile can be highlighted
with make syntax, but a 'cc' or 'ini' file does not get treated like
a *.cc or *.ini file.
Currently the underlying highlighting lib syntect and the sublime syntax
definitions can not make this distinction
(<http://www.sublimetext.com/docs/syntax.html>).
|
|
Fixes #587
|
|
* generate-completion subcommand
* add Makefile target and replace completion scripts in repo with generated output
* Add completion to manual
|
|
Rust 1.70 stabilized the `IsTerminal` trait and the newest version of
`grep-cli` crate depending on it, makes it possible to remove the
unmaintained `atty` crate from the build.
```
Crate: atty
Version: 0.2.14
Warning: unsound
Title: Potential unaligned read
Date: 2021-07-04
ID: RUSTSEC-2021-0145
URL: https://rustsec.org/advisories/RUSTSEC-2021-0145
```
|
|
* Move tabs logic into utils
* Re-use buffer returned by tabs::expand
* Add TabCfg to configure tabs
Use the String from this config for the tab replacement. This avoids
creating a new String for each processed line.
* Avoid unicode segmentation for each line just to remove a prefix
In some code paths no prefix is removed, and in almost all other
cases the prefix is just ascii.
This simplifies a lot of calls.
* Set default tab with to 8
Editors like vim, emacs, nano and most terminal emulators set
this value as the default tab display width.
|
|
|
|
The command failed because the two empty arguments for the internal `Opt`
parsing actually meant "<binary> <minus_file>" and since `minus_file` is now
parsed with `PathBufValueParser` and the value parser rejects empty values.
|
|
The colors are already sorted and can be returned as they are defined.
|
|
* Fix clippy warnings
- `clippy::uninlined_format_args`
* Fix clippy warnings
- `clippy::clone_on_copy`
- `clippy::explicit_auto_deref`
- `clippy::iter_cloned_collect`
- `clippy::map_clone`
- `clippy::needless_borrow`
- `clippy::needless_lifetimes`
- `clippy::needless_return`
- `clippy::redundant_clone`
- `clippy::redundant_field_names`
- `clippy::seek_to_start_instead_of_rewind`
- `clippy::unnecessary_cast`
- `clippy::unused_unit`
|
|
|
|
This allow to no longer ignore some tests (marked previously as FIXME)
by storing the env at the start of the program (Or creating a custom env
for test purpose)
This centralize almost alls calls to std::env inside one wrapper
Add a test profile to increase speed for testing (5min -> 20sec on my
machine)
clean a few code style like this:
```
if Some(value) = ...
if value
```
to
```
if Some(true) = ...
```
Co-authored-by: William Escande <wescande@google.com>
|
|
Fixes #989
|
|
Use assets API from bat library
Fixes #895
Ref https://github.com/sharkdp/bat/issues/2026
Thanks @Enselic
|
|
When detecting input generated by `delta <(echo foo) <(echo bar)`
fall back to plain `diff` instead of `git diff --no-index`.
This does not respect various git settings anymore (the original reason
to switch from `diff` to `git diff`), but is better than just showing
the names of the temporary files.
|
|
Fixes #965
|
|
Fix file paths and hyperlinks
With this commit the target of a hyperlink should always be an absolute path. This should be true for all file hyperlinks, e.g.
- File hyperlink
- Hunk header hyperlink
- Line number hyperlink
Fixes #890
|
|
|
|
Replace structopt with clap
Fixes #888
* Drop tests of deprecated options
They were failing
|
|
|
|
ref #829
|
|
|
|
|
|
With this commit combined diff
format (https://git-scm.com/docs/git-diff#_combined_diff_format) is
handled appropriately. However, there is no special handling of merge
conflict markers.
Fixes #189, #736
|
|
|
|
* Allow navigate-regexp value to be overridden.
* Don't add an empty label to the navigate_regexp.
* Make --hunk-label=str not require --navigate.
* Change navigate regexp to navigate regex.
* Turn navigate-regex into an Option<String>.
|
|
Color groups from https://www.w3schools.com/colors/colors_groups.asp
|
|
Similar to 7a64fa5a26314c05c811d7c1276388a4963fa0bd which allowed
custom styles. Custom styles must end in -style, but colors can be
anything. It unfortunately seems not to be possible currently to store
a global reference to git config, hence the size of this
commit (passing the reference down the call stack).
|
|
This allows the file1 -> file2 arrow to be configured to whatever
characters the user desires. The default is the same unicode arrow as
before with 2 spaces after it, since this allows someone to remove the
extra spaces that are in the current output.
|
|
|
|
Fixes #426
Partial versions of these changes were previously in master and then
reverted multiple times.
See #746
0745f853d4bed52aca0b6739ac452d54ff54a153
3aab5d19569fa52ace2d7e6d196a1256990c4e20
|
|
|
|
* Fix two typos
* Dismantle two Pyramids of Doom
Use question mark operator instead
* Use fatal() to exit with errorcode 2
|
|
This does not use the values provided by default_value, so
validation will fail.
|
|
In side-by-side mode, if `background_color_extends_to_terminal_width`
is set, the left panel color is extended via spaces, but the right
one via an ANSI sequence which instructs the terminal emulator to
fill the background color rightwards.
The command line option --line-fill-method ansi|spaces can change
how the right panel background is filled.
Add enums `BgShouldFill` and `BgFillMethod` to better distinguish
if the background should be filled, and if so, how.
|
|
|