summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2022-02-14Fix hyperlink absolute paths (#939)0.12.0Dan 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-25Use sysinfo::Pid as less as possibleGuillaume Gomez
2022-01-25Fix clippy lintsGuillaume Gomez
2022-01-25Update sysinfo version to 0.23Guillaume Gomez
2022-01-21Show blame line numbers via blame-separator-formatThomas Otto
Prefix and suffix of the format string are separator-style highlighted, format options are none, {n}, {n:block}, {n:every-N}.
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-19clap: Use term_width(0) instead of term_width(usize::MAX)Dan Davison
0 means "no wrap" https://github.com/clap-rs/clap/issues/3300#issuecomment-1015578541
2022-01-19Prevent clap from switching to multiline format for short helpDan Davison
Ref https://github.com/clap-rs/clap/issues/3300 Fixes #377
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-17Slight improvement on long cosmetic arg name in help outputDan Davison
2022-01-17More minimizing of cosmetic argument names in help outputDan Davison
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-17Improve tests of hunk header / hyperlinks behaviourDan Davison
2022-01-16Add a note about `delta -h` to the long help outputDan Davison
2022-01-16Sort options in --help outputDan Davison
2022-01-16Add clap cosmetic argument namesDan Davison
2022-01-16Fix idiotic test assertionDan Davison
2022-01-16Drop deprecated options (#914)Dan Davison
Drop deprecated options Fixes #891
2022-01-15structopt to clap (#889)Dan Davison
Replace structopt with clap Fixes #888 * Drop tests of deprecated options They were failing
2022-01-13Handle blame author names containing parenthesesThomas Otto
2022-01-13Fix new 1.58 clippy lintsThomas Otto
2022-01-10Add diff-stat-align-width to show-configDan Davison
2022-01-06New option file-transformation to transform file pathsDan Davison
2022-01-05Clippy: remove redundant borrowsDan Davison
2022-01-05Handle a mode change on a renamed file. (#875)Wayne Davison
* 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.
2022-01-05Fix grep parse bugs (#865)Dan Davison
Evolve grep output parsing heuristics * Demand a non-space before extension * New grep parse heuristic If something like any of the following are seen then that is assumed to be a file name with an extension followed by a line number. I.e. we do not support file names with such patterns internally. .xx-7- .xx=7= .xx:7:
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
2022-01-03Cache parent process when testing unless FakeParentArgs are usedThomas Otto
2022-01-03The calling process must have a common parent with deltaThomas Otto
Ensures that no unrelated process is found when selectively refreshing a pid range.
2022-01-03Move parent process query into a threadThomas Otto
Start the query even before determining if information about the parent process is required (which are most invocations anyhow).
2022-01-03Re-enable full process scans on LinuxThomas Otto
2022-01-03Disable /proc fd caching on Linux when querying processesThomas Otto
This query only happens once, so caching is not needed Also update sysinfo version to fix a crash related to this.
2022-01-01Put file-modified label in front of mode changes.Wayne Davison
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.
2021-12-28Use formatted blame metadata as blame keyDan Davison
Fixes #868
2021-12-28blame-separator and blame-separator-style optionsDan Davison
2021-12-28Refactor blame handlerDan Davison
- Give up on repeat blame line optimization - Don't assume blame key is commit
2021-12-24Remove space from blame-formatDan Davison
2021-12-24New option blame-code-styleDan Davison
Fixes #867
2021-12-15Update --help textDan Davison
2021-12-14Line state refactor (#851)Dan Davison
* Refactor: compute raw line and new line state
2021-12-14Delete calls printing output in testsDan Davison
2021-12-14Add inspect_raw method to DeltaTestDan Davison
2021-12-14Add markers surrounding DeltaTest::inspect() outputDan Davison
2021-12-14Don't take syntax-theme from env var during testsDan Davison
Fixes #842
2021-12-14Revert "Ignore test maing ANSI assertions"Dan Davison
This reverts commit 424fe8b59ad33cf80ec16b33c858525daec82716.
2021-12-13Clean up DeltaTest argumentDan Davison