summaryrefslogtreecommitdiff
path: root/src/features
AgeCommit message (Collapse)Author
2024-12-10hyperlink commit hashes of length 7 as wellThomas Otto
2024-11-20Allow multiple hyperlinks per lineThomas Otto
Previously only the last commit was linked. Do not link numbers (technically also commits), and stop after finding 12 commits on a line.
2024-11-20testability: add pretty_assertions, git mocksThomas Otto
2024-11-16Support {host} in hyperlinks (#1901)Dan Davison
* Support {host} in hyperlinks * Improve help text
2024-09-08Replace "light mode" bool with a dedicated enumTau Gärtli
2024-08-01OutputType: PagerCfg and oneshot_writeThomas Otto
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.
2024-07-21Disable light mode detection in tests (#1765)Tau Gärtli
2024-07-07tests: set terminal width to 43 (#1741)Thomas Otto
Make tests more deterministic by not allowing them to "see" the current terminal width.
2024-07-06tests: add insta for snapshot testing (#1739)Thomas Otto
Insta makes writing new tests or performing changes which update the expected value(s) easier. The new reference data can be reviewed and inserted/updated automatically by `cargo insta review` (after `cargo install cargo-insta`, but that tool is optional). The snapshots are stored inline using the `@""` syntax and not in separate files because the delta test output is small and designed to be human readable. See https://insta.rs/#hello-snapshot-testing and https://docs.rs/insta/1.39.0/insta/
2024-06-24Don't read git files when --no-gitconfig is given + unused variables (#1728)Thomas Otto
* 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.
2024-03-12Detect Dark/Light Mode from Terminal (#1615)Tau
2024-02-19Accept clippy suggestions (#1632)Dan Davison
2023-06-02Introduce grep-output-type option: ripgrep or classicDan Davison
2023-03-09Add methods for getting `GitConfig` as reference (#1336)nickelc
2023-03-05Return the `GitRemoteRepo` type directly (#1328)nickelc
The type is unnecessarily wrapped and it's the only use for `GitConfigEntry::GitRemote` enum variant.
2023-03-05Update dependencies & switch back to the `dirs` crate (#1325)nickelc
* Update direct dependencies * Update transient dependencies * Switch back to `dirs` crate The `dirs`/`dirs-sys` repositories are unarchived and the crates are maintained again, while `dirs-next` crates aren't.
2023-03-05Encapsulate `git2` types (#1326)nickelc
* Move theme iteration logic to `GitConfig` The `git2::Config` type is now encapsulated and the regex is given to `libgit2` to filter the config entries. * Move remote url getter to `GitConfig`
2023-03-03Spelling (#1257)Josh Soref
Corrects misspellings identified by https://github.com/marketplace/actions/check-spelling Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-28Fix clippy warnings (#1298)nickelc
* 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`
2022-12-03try fix bad alignment in unicode (#1144) (#1145)Sheldon Nico
* try fix bad alignment in unicode (#1144) * use width instead of count in wrap_line * fix fmt * 3 tests do not need fail * fix tests Co-authored-by: Thomas Otto <th1000s@posteo.net>
2022-11-13Fix clippy warnings (#1236)clnoll
2022-10-11Fix clippy warnings after rust 1.64 upgradeThomas Otto
2022-08-16Fix clippy warnings after rust 1.63 upgrademliszcz
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.
2022-06-20Fix commit hyperlink formatting (#1110)Dan Davison
2022-05-23Tweak some words improved representation (#1078)Yudai Takada
* Use "overridden" instead of "overriden" * Use "line_numbers" instead of "linennumbers" * Use "context" instead of "contexct" * Use "summary" instead of "sumary"
2022-03-30Add custom env struct to store env at init (#1025)William Escande
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>
2022-02-21Enable commit links for GitLab (#972)Johan Wärlander
* Enable commit links for GitLab
2022-02-14Fix hyperlink absolute paths (#939)Dan Davison
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
2022-02-07Fix unused imports and functions warnings on windowsThomas Otto
Otherwise these warnings clutter the github diff display.
2022-01-21Placeholder may contain a type fieldThomas Otto
Similar to Pythons `{n:2.1f}` where f indicates a floating point type. The type may be separated by an underscore: `{n:<15.14_type}`. Add a FormatStringPlaceholderDataAnyPlaceholder template which works without a borrowed Placeholder.
2022-01-18Center Align numbers right-ish (#883)Thomas Otto
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.
2022-01-18Cwd fixups (#918)Dan Davison
Do cwd computations once only; rename cwd variable
2022-01-17Construct hyperlink file path relative to cwdDan Davison
Fixes #890
2022-01-17Add failing test of file hyperlink in git repoDan Davison
2022-01-04Make Config cloneable for DeltaTest, store as Cow<Config> thereThomas Otto
Only cloneable when testing, the types git2::Config and git2::Repository in GitConfig contain C pointers and can't really be cloned.
2022-01-04DeltaTest improvements (#876)Wayne Davison
* DeltaTest improvements - Added .expect_contains(), .expect_raw_contains(), and .expect_contains_once() member functions to DeltaTestOutput. These functions also output some helpful debug info when the assert fails. - Separated .with_config_and_input() into .with_config() and (the tweaked) .with_input(). - Made .with_config() create a DeltaTest object (like .with() does). - Renamed .with() as .with_args(). - Moved .explain_ansi() from DeltaTestOutput to DeltaTest, which must now be called prior to .with_input() since the latter stashes off both the raw_output & the processed output in the object. - Changed .expect() and .expect_skip() to return Self so that they can continue a chain of multiple expect calls (e.g. a series of partial matches with different skip values). - The processed output text can be accessed via `test_obj.output` (see also `test_obj.raw_output`). - Renamed .expect_skip() to .expect_after_skip(). - Changed .expect() to start at the first line. - Added .expect_after_header() that works like the old .expect(). - Renamed lines_match() to assert_lines_match() and made it match all lines (no skip number). - Added assert_lines_match_after_skip() to work like the old lines_match() function, but with the .expect_after_skip() arg order. - Converted some old-style tests into DeltaTest style tests. - Renamed set_cfg as set_config
2021-12-14Line state refactor (#851)Dan Davison
* Refactor: compute raw line and new line state
2021-12-14Revert "Ignore test maing ANSI assertions"Dan Davison
This reverts commit 424fe8b59ad33cf80ec16b33c858525daec82716.
2021-12-12DELTA_FEATURES appends iff prefixed with +Dan Davison
Thanks @bew for the suggestion. Fixes #848
2021-12-11Store history file in data_local_dir for Windows (#847)Rashil Gandhi
* Store history file in data_local_dir * Be specific
2021-12-09Store raw_line in HunkZero, as HunkMinus and HunkPlusDan Davison
ref #829
2021-12-08Ignore test maing ANSI assertionsDan Davison
This fails currently in some environments. Fixes #842
2021-12-07Fix more side-by-side line number miscountsThomas Otto
2021-12-07Add DeltaTest to speed up adding and fixing testsThomas Otto
Using a syntax similar to the builder pattern: `DeltaTest::with([config options]).with_input(DIFF).expect(lines)` plus `.explain_ansi()` to pretty-print ansi codes and `.inspect()` to print the to-be-tested output. Rewrite a few tests using it and add ansi tests for --line-fill-method=<spaces|ansi>
2021-12-05Display merge conflictsDan Davison
2021-12-05Handle combined diff formatDan Davison
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
2021-12-02Fix side-by-side line number miscountThomas Otto
2021-11-28Do not fill entirely new/removed lines with non-emph styleDan Davison
2021-11-28Refactor: hunk style sections handlingDan Davison
- Factor out a new function update_diff_style_sections - Use MinusPlus construct more
2021-11-27Refactor: further isolate side-by-side implementation (#801)Dan Davison