| Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
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.
|
|
`relativize_path_maybe()` was not called in this case. Added
test and converted a few existing ones to insta.
|
|
This simplifies the call sites.
Also skip updating if the path is already absolute, and handle
'/dev/null' on Windows so it is no longer converted to '\dev\null'.
|
|
|
|
* 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>).
|
|
|
|
|
|
* 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`
|
|
Otherwise the file extension would return 'rs"' which does not
match any language.
|
|
|
|
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.
|
|
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
|
|
Fixes #1010
|
|
Fixes #1002
|
|
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
|
|
* 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.
|
|
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.
|
|
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
|
|
|