| 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.)
|
|
* Support {host} in hyperlinks
* Improve help text
|
|
The output and exit code of run_app() are now testable, used for diff test.
|
|
|
|
* 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()`
|
|
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).
|
|
--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.
|
|
Accidentally introduced in #1744
|
|
Also sort the options alphabetically
|
|
* 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>).
|
|
|
|
* generate-completion subcommand
* add Makefile target and replace completion scripts in repo with generated output
* Add completion to manual
|
|
|
|
Ref #1467
|
|
|
|
|
|
* 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.
|
|
Fixes #1316
|
|
The `try_create_from_path` function and the `from_path` function for
tests can be merged into a single function.
|
|
|
|
|
|
|
|
* feat: Added config option.
|
|
* Update to clap 4
* Add help, usage, error-context features to clap
* Add wrap_help clap feature
* Remove DeriveDisplayOrder as it is now default
* Update ValueSource using statement
* Update #[clap(...)] to #[command(...)]
* Update #[clap(...)] to #[arg(...)]
* Update #[structopt(...)] to #[arg(...)]
* Remove value_parser because it is now default
* Return option & argument names as `String` due to lifetime issues
* Remove leading hyphens from arguments long definition
Leading hyphens are no longer accepted.
* Argument names are derived from field names and `snake_case`
* `help` & `version` are no longer added automatically
* Update `clap` to 4.1.8
---------
Co-authored-by: tjquillan <tjquillan@gmail.com>
|
|
Corrects misspellings identified by https://github.com/marketplace/actions/check-spelling
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
|
|
* Address deprecated clap features
* Move to Arg::get_id from Arg::get_name
* Move to ArgMatches::value_source
* Run rustfmt
|
|
Following fixes are included:
* derive_partial_eq_without_eq:
Eq trait was added by running `cargo clippy --fix --no-deps`.
* get_first:
Function was replaced by running `cargo clippy --fix --no-deps`.
* unnecessary_to_owned:
This check was disabled for ANSIString as to_string call is required
to enforce formatting. Otherwise the underlying string was returned
directly (probably due to Deref implementation).
* type_complexity:
Closure type was simplified and Box<> usage was removed.
|
|
New CLI/config option is introduced: blame-timestamp-output-format.
Fixes #1157.
|
|
|
|
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>
|
|
|
|
|
|
Use assets API from bat library
Fixes #895
Ref https://github.com/sharkdp/bat/issues/2026
Thanks @Enselic
|
|
|
|
Prefix and suffix of the format string are separator-style highlighted,
format options are none, {n}, {n:block}, {n:every-N}.
|
|
0 means "no wrap"
https://github.com/clap-rs/clap/issues/3300#issuecomment-1015578541
|
|
Ref https://github.com/clap-rs/clap/issues/3300
Fixes #377
|
|
There is no such thing as "Center Align" with discrete terminal cells. In
some cases a decision has to be made whether to use the left or the right
cell, e.g. when centering one char in 4 cells: "_X__" or "__X_".
The format!() center/^ default is left, but when padding numbers these
are now aligned to the right if required. Strings remain left-aligned.
|
|
|
|
|
|
|
|
|
|
|
|
Drop deprecated options
Fixes #891
|
|
Replace structopt with clap
Fixes #888
* Drop tests of deprecated options
They were failing
|
|
|