summaryrefslogtreecommitdiffstats
path: root/src/style.rs
AgeCommit message (Collapse)Author
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.
2021-12-09RefactorDan Davison
Ref #829
2021-12-05PERF: Add commentDan Davison
2021-11-23New option to map raw styles encountered in inputDan Davison
Unify handling of styles parsed from raw line and computed diff styles. This enables syntax highlighting to be used in color-moved sections. Fixes #72
2021-11-22Allow custom colors to be defined in gitconfig (#788)Dan Davison
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).
2021-11-15Handle `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-10Add compact debug formatting for StyleThomas Otto
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-06-23Lint: function named to_* should consume argumentDan Davison
2021-01-08Clippy (#496)Dan Davison
2020-12-31Add styles for file path and line number in hunk headerDan Davison
Fixes #481
2020-11-07remove some clippy warnings (#383)Marco Ieni
* remove some clippy warnings * revert comparison_chain clippy lint Allow it locally
2020-11-05fix some clippy warnings (#380)Marco Ieni
2020-08-14New ANSI escape sequence parser based on vteDan Davison
Reimplement utility functions from `console` crate, but with support for OSC sequences.
2020-08-01Change parse_first_style() to take &str instead of bytes iteratorDan Davison
2020-08-01Add failing test for blink attribute in color.diff.{old,new}Dan Davison
2020-08-01Add trailing commaDan Davison
2020-08-01Parse ANSI escape sequences as ansi_term StyleDan Davison
2020-08-01Emit raw lines instead of explicitly handling --color-movedDan Davison
2020-08-01Initial implementation of color-moved supportDan Davison
- Inspect the raw hunk line - If it does not appear to be a standard minus/plus line, treat it as moved - Apply special delta color-moved-* styles
2020-07-13Refactor: has_background_color() -> get_background_color()Dan Davison
2020-06-27Improve --show-styles commandDan Davison
2020-06-27Refactor: pass foreground & background defaults as a single StyleDan Davison
2020-06-26New command --show-stylesDan Davison
Drop old command --show-background-colors
2020-06-26Refactor: parse_style moduleDan Davison
2020-06-19Refactor: add native style.paint() methodDan Davison
2020-06-17Highlight added/removed empty lines if they would be invisibleDan Davison
Thanks @phillipwood
2020-06-10Refactor: Config::from_argsDan Davison
2020-06-10Don't interpret 'ul' and 'ol' specially in style stringsDan Davison
'underline' and 'overline' are interpreted specially (as a decoration directive), for backwards-compatibility with early versions of delta.
2020-06-02Implement compositional decoration attributesDan Davison
Ref #205
2020-05-31Allow --ELEMENT-style=none meaning no styleDan Davison
2020-05-31Function did not need to be publicDan Davison
2020-05-31Allow --ELEMENT-decoration-style=noneDan Davison
2020-05-30Hack: add boolean to Style struct to identify non-emph stylesDan Davison
This isn't a correct approach. The problem being addressed is that currently, Style instances are being used to represent things like the presence of an emph section in a line with edit annotations. A consequence is that if an emph and non-emph section are styled the same, then it's impossible to tell that the sections are different in any way at all. I think the correct approach is probably to start using a Struct that models elements such as emph/non-emph to represent these things, and make each such struct instance possess a style.
2020-05-30Add is_omitted field to Style structDan Davison
2020-05-30Make decoration style non-optionalDan Davison
2020-05-29Introduce is_raw style attributeDan Davison
If this attribute is set in --thing-style then the `thing` element text received from git should be passed though unchanged. (It may or may not have a decoration.)
2020-05-29Change decoration style enum variant name: Omit => NoDecorationDan Davison
2020-05-28Support same style attribute and color names as gitDan Davison
2020-05-27Be more permissive: take first of multiple special attributesDan Davison
2020-05-27Bug fix: e.g. underline in --minus-style was not taking effectDan Davison
2020-05-27Add failing test of underline attributeDan Davison
2020-05-27Refactor: Create color and theme modules, consolidate style codeDan Davison
2020-05-27Add overline and underoverline decoration stylesDan Davison
2020-05-26Implement --{commit,file,hunk-header}-{style,decoration-style}Dan Davison
2020-05-22Use new Style struct, wrapping ansi_term::StyleDan Davison
2020-05-22Implement hunk styles using style string argumentsDan Davison
- Do not apply foreground syntax style if it is "null syntect style" This isn't really correct. We should find either a valid sentinel value, or a way to only do the superimposing when we're doing syntax-highlighting. - Add --zero-style option (style for unchanged hunk lines) - Implement --color-only using an option rewrite rule
2020-05-22Use ansi_term style data structures instead of syntectDan Davison
2020-05-22Introduce style strings to replace color optionsDan Davison
https://git-scm.com/docs/git-config#Documentation/git-config.txt-color - Support "syntax" pseudo foreground color - Delete the --syntax-highlight CLI option This was never released.
2020-03-01Support 256-color terminal environmentsDan Davison
Fixes #110 With this commit, delta enters "24 bit color mode" iff either of the following are true: 1. The --24-bit-color command line option value is "always" 2. The --24-bit-color command line option value is "auto" and the COLORTERM environment variable is set to "truecolor" or "24bit". See https://gist.github.com/XVilka/8346728#true-color-detection https://github.com/sharkdp/bat/blob/7779d9f6221b3e98c43a43ceb5596ba285fdf4f8/src/bin/bat/app.rs#L29-L33 Otherwise, delta enters "8-bit color mode". In "24 bit color mode", delta will 1. Emit 24-bit RGB color shell escape sequences that will only be displayed correctly by a terminal application that supports 24 bit colors. 2. Select default background colors that will only be displayed correctly by a terminal application that supports 24 bit colors. In "8-bit color mode", delta will 1. Emit color shell escape sequences specifying the entry in the ANSI 256 color palette that is closest (according to the ansi_colours library) to the requested color. 2. Select default background colors that will work well in a terminal application that supports 8-bit color but not 24-bit color.