summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2021-11-14Evolve grep line parsing regex769-git-grep-devDan Davison
2021-11-14Add failing testDan Davison
2021-11-14Rename enum variantDan Davison
2021-11-14Handle grep outputDan Davison
- Handle standard filepath:code and filepath:line_number:code output as produced by `git grep`, `rg -H`, `grep -H`, etc (with -n for line numbers). - Retain the match highlighting as produced by the grep tool, and expose it in delta's color output styled with grep-match-style. (Note that --color=always is needed to retain the color if piping into delta, but not for `git grep` when delta is configured as git's pager) - Special handling of -p, and -W options of `git grep`: these display the function context in which the matches occur. - `navigate` keybindings jump between match function contexts under `git grep -p` and between matching lines under `git grep -W`. Thanks @zachriggle for the proposal. Fixes #769
2021-11-14Refactor: get_painted_file_with_line_number functionDan Davison
2021-11-14Refactor: StyleSectionSpecifier enum for syntax_highlight_and_paint_lineDan Davison
2021-11-14Function to compute text index in string containing ANSI sequencesDan Davison
2021-11-14Clarify tests of ansi_preserving_sliceDan Davison
2021-11-14Parse styles from a string containing ANSI sequencesDan Davison
2021-11-14Parse option keys from parent process command lineDan Davison
2021-11-14Try to determine blame file language from parent processDan Davison
2021-11-14Handle `git blame` outputDan Davison
Fixes #426 Partial versions of these changes were previously in master and then reverted multiple times. See #746 0745f853d4bed52aca0b6739ac452d54ff54a153 3aab5d19569fa52ace2d7e6d196a1256990c4e20
2021-11-14Support precision specifier in run-time format stringsDan Davison
2021-11-14Clean upDan Davison
2021-11-14Util: check parent process for filenameThomas Otto
Usecase: With delta used as a pager the command `git blame main.rs` calls delta, but the piped data does not mention the filename. Instead try to get the filename extension from the parent `git` process.
2021-11-14Sort config struct entriesDan Davison
2021-11-10Remove +/- line prefix instead of substituting a spaceThomas Otto
Simplifies line handling and printing by removing a "magical" 1-offset previously required in various locations. Now explicitly prepend "" in `tokenize()`.
2021-11-10Add compact debug formatting for StyleThomas Otto
2021-11-01Simplify lifetime annotation of Painter (#758)Thomas Otto
The struct's lifetime is not used outside new(), and most of the methods used more like free functions, so uniformly use 'a there. Also fix wrongly used lifetime for get_syntax().
2021-10-29Do not reformat submodule diffs under `git add -p` (#756)Dan Davison
Fixes #755 Ref #662
2021-10-26Delete unused blame CLIDan Davison
This should have been done in 0745f853d4bed52aca0b6739ac452d54ff54a153 and the command line options were therefore incorrectly released in 0.9.0.
2021-10-26Fix side-by-side mode without line numbers0.9.0Thomas Otto
Even though this feature enables line numbers, these can be disabled via the git config `delta.line-numbers=false`. So always enable line numbers, even if they do not print numbers. Construct more structs with ..Self::default()
2021-10-26Simplify incrementing of line numbersThomas Otto
2021-10-26Revert "Revert "Revert git blame handling (#746)""Dan Davison
This reverts commit 8886648374e59cb27ff6dfd240a7b7207a617bfd.
2021-10-26Revert "Revert git blame handling (#746)"Dan Davison
This reverts commit ec372683a190427c0fc7b31646849da10996a940. This reverts commit ff25f2ba3be40c0ddb2354c642a7ef453ad92d45.
2021-10-26Revert git blame handling (#746)Dan Davison
* Security bug: time-rs/time#293 https://rustsec.org/advisories/RUSTSEC-2020-0159.html https://github.com/dandavison/delta/runs/4003260368?check_suite_focus=true * No fix available in the chrono crate: https://github.com/chronotope/chrono/issues/602
2021-10-25Re-enable ANSI fill by equalizing panel sizesThomas Otto
Make the two panels in side-by-side use the full terminal width by inserting an extra space in the center between the panels if the width is odd and ANSI filling is enabled. Fall back to spaces when the output is not to a terminal.
2021-10-25Remember if stdout is to an interactive terminalThomas Otto
Adapted `set_widths` because that's where there's a Term instance already.
2021-10-25Linenumber test helper addedThomas Otto
2021-10-25Wrap linenumber configs in MinusPlus or LeftRightThomas Otto
2021-10-18Use fatal() to exit with errorcode 2 (#739)Thomas Otto
* Fix two typos * Dismantle two Pyramids of Doom Use question mark operator instead * Use fatal() to exit with errorcode 2
2021-10-18Convert Align and Placeholder into enumsThomas Otto
Also move number and style logic out of `format_and_paint_line_numbers()` and into a separate `linenumbers_and_styles()` function.
2021-10-18Store line number prefix/suffix as SmolStrThomas Otto
2021-10-18Width can be an offset from the terminal width (#727)Thomas Otto
No longer subtract 1 from the terminal width to accommodate e.g. `less --status-columns`, instead set `--width -1` explicitly.
2021-10-16Change PlusMinus to the correct MinusPlus, add documentationThomas Otto
2021-10-16Tests: store length of skipped header separatelyThomas Otto
2021-10-16Fix clippy warning needless_option_as_derefThomas Otto
2021-10-16Add inline-hint-style option and use for side-by-side wrap symbolsDan Davison
2021-10-16Rename syntect moduleDan Davison
2021-10-16Add side-by-side line wrappingThomas Otto
If the current line does not fit into the panel, then it is not truncated but split into multiple lines. A wrapping symbol is placed at the end of the line. If the new line is short enough, it is right-aligned. Wrapping is limited to a certain number of lines (--wrap-max-lines), if this is exceeded the line is truncated by a now highlighted truncation symbol. To disable wrapping set this value to 0.
2021-10-16Add line number width calculationThomas Otto
2021-10-16Left/Right converted into a simple typedefThomas Otto
2021-10-16StructOpt without DefaultThomas Otto
This does not use the values provided by default_value, so validation will fail.
2021-10-16Add fatal() function to handle exiting on errorsThomas Otto
Panic when testing or exit with return value 2.
2021-10-13Use bullet as default hunk marker in navigate modeDan Davison
Ref 130b0b6a #684
2021-09-19Option to set the background extension mode to ANSI or spacesThomas Otto
In side-by-side mode, if `background_color_extends_to_terminal_width` is set, the left panel color is extended via spaces, but the right one via an ANSI sequence which instructs the terminal emulator to fill the background color rightwards. The command line option --line-fill-method ansi|spaces can change how the right panel background is filled. Add enums `BgShouldFill` and `BgFillMethod` to better distinguish if the background should be filled, and if so, how.
2021-09-19General PlusMinus data structureThomas Otto
Can be indexed with Minus/Plus or in a side-by-side context with Left/Right to represent the left/right Panels.
2021-09-15Remove superfluous lowercasing of feature names. (#718)Levi Bard
Fixes #716
2021-09-15Display removed file name in file deletion case (#717)Dan Davison
2021-09-02Fix interaction between navigate and (hunk-header-style without "line-number")Dan Davison
Prior to this commit we were emitting a spurious colon when hunk-header-style was set to a value such as "syntax" (i.e. not including "line-number") and navigate was enabled. Fixes #672