| 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.
|
|
--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.
|
|
`relativize_path_maybe()` was not called in this case. Added
test and converted a few existing ones to insta.
|
|
Make tests more deterministic by not allowing them
to "see" the current terminal width.
|
|
* 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>).
|
|
* Honor default-language option
* Add tests for default-language option
---------
Co-authored-by: Dan Davison <dandavison7@gmail.com>
|
|
Closes #320
|
|
|
|
|
|
Fixes: #1032
|
|
* added binary file cases tests
* add binary file cases handling
* remove unnecessary return and comma
|
|
Fixes #1408
|
|
Fix #137
|
|
Added support for an optional -dirty hash suffix which is present
in `git diff` output when files were changed in a submodule.
|
|
Corrects misspellings identified by https://github.com/marketplace/actions/check-spelling
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
|
|
* 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`
|
|
The pending buffer for whole-file changes is currently only flushed when
encountering a new diff header. This leads to it being carried over
across commit boundaries in cases where multiple commits are shown. To
fix this, we simply need to flush the buffered data on a commit
boundary as well.
Fixes #1089
|
|
Fix #128
Add support for `git diff -D` (aka irreversible delete)
The patch is adding a title for removed file, even when there is no file content in the diff output
Without the patch, there was no output related to the file at all
|
|
|
|
Drop deprecated options
Fixes #891
|
|
* Handle a mode change on a renamed file.
I changed the diff parsing to cache the mode info from the old/new mode
lines until the parsing bumps into the start of the actual related diff,
finds the diff line for an unrelated diff, or runs out of input. This
allows the mode info to be output in conjunction with a file event
instead of as a separate heading (that used to have an empty name when
the mode change was for a rename).
The mode info is passed down into the draw routines as a separate
"addendum" string that the draw code can use as it likes. Currently that
means that it appends the addendum string to the non-raw string in
parens. I imagine that future draw routines could decide to put it in a
separate box or some other per-routine method. There is currently a
single function in src/handlers/draw.rs that joins the strings in the
same way for everyone.
A couple examples of how the new code looks:
Δ foo.rs (mode +x)
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name (mode +x)
───────────────────────────────────────────────────
Would it look better on its own line?
Δ foo.rs
• mode +x
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name
• mode +x
───────────────────────────────────────────────────
Would it look better appended after a "•" character?
Δ foo.rs • mode +x
───────────────────────────────────────────────────
renamed: old-longer-name → shorter-name • mode +x
───────────────────────────────────────────────────
Should it be a user option? If so, we can do that later.
|
|
* 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
|
|
When using `--navigate` with files that get their mode modified, the
file-modified label was not being prefixed, so these changes were not
being marked as skip destinations. This is particularly bad if a file
has line changes along with the mode change AND the user has an empty
hunk label (since that would make the entire file's changes get skipped
with an "n").
I added a test of a mode-change with a line-change, and a test for a
mode change where the old & new mode values are not one of the two
expected value-pairs. I also used format_file() on the mode filenames
since the other format() calls were using it.
|
|
ref #829
|
|
Fixes #765
|
|
|
|
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
|
|
|
|
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 addresses a bug triggered by doing things like
minus-style = minus-emph-style
That was causing the is_emph bit to be set on minus-style, with
undesirable consequences.
|
|
When filtering a diff and when directly diffing files/dirs, use the
modified label that is output when interpreting git diffs. This gets
rid of the "comparing:" prefix (which was otherwise missing from the
--navigate regex) and ensures that a direct diff has a label to stop at
when --navigate is enabled. One of the unified-diff tests now uses
--file-modified-label=comparing: to generate the same output as before,
while the other now uses --navigate to get a delta char label.
|
|
Simplifies line handling and printing by removing a "magical"
1-offset previously required in various locations.
Now explicitly prepend "" in `tokenize()`.
|
|
* Rename state machine state: Submodule -> SubmoduleLog
* More minimalistic display of submodule log diffs
Partially fixes #662
* Defer emitting hunk header until first true hunk line
A consequence is that we do not emit the (pseudo) hunk header in
submodule (short) state; see #662.
|
|
|
|
|
|
* Strip a neglected CR character in ingest_line
* Add test_orphan_carriage_return_is_stripped
* Eliminate redundant assignment in if-let-Some
|
|
|
|
|
|
* Fix parsing of file path from diff line
Fixes #625
* Parse diff line only if needed
* Add test of diff of filenames with spaces
* Strip trailing tab inserted by git when file path contains space
git appears to add a trailing tab character when the file name contains a space:
$ git diff --no-index b.file 01g\ -\ Text | cat -A
diff·--git·a/b.file·b/01g·-·Text␊
index·e69de29..d00491f·100644␊
---·a/b.file␊
+++·b/01g·-·Text├──┤␊
@@·-0,0·+1·@@␊
+1␊
|
|
* Refactor: hyperlinks utility
* Add hyperlinks-commit-link-format option
Fixes #613
|
|
Ref #583
|
|
Fixes #583
|
|
Fixes #567
|
|
Fixes #481
|
|
Hyperlinks seem to be rendering with just the file path underlined, at
least in iTerm2, whereas the intention was for the file and
line-number to be rendered jointly (both underlined) as a hyperlink.
The link structure is
␛]8;;file-line-column:///Users/dan/src/delta/src/hunk_header.rs:114␛\␛[38;5;1msrc/hunk_header.rs␛[0m:␛[38;5;4m114␛[0m␛]8;;␛\:
|
|
|
|
|
|
|
|
|
|
Ref #309
|