summaryrefslogtreecommitdiffstats
path: root/src/options/set.rs
AgeCommit message (Collapse)Author
2021-11-23Add --parse-ansi commandDan 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-22Navigate regexp (#782)Wayne Davison
* Allow navigate-regexp value to be overridden. * Don't add an empty label to the navigate_regexp. * Make --hunk-label=str not require --navigate. * Change navigate regexp to navigate regex. * Turn navigate-regex into an Option<String>.
2021-11-22Show colors subcommandDan Davison
Color groups from https://www.w3schools.com/colors/colors_groups.asp
2021-11-22Handle 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-17Add the --right-arrow option.Wayne Davison
This allows the file1 -> file2 arrow to be configured to whatever characters the user desires. The default is the same unicode arrow as before with 2 spaces after it, since this allows someone to remove the extra spaces that are in the current output.
2021-11-15Refactor: utils moduleDan Davison
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-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-25Remember if stdout is to an interactive terminalThomas Otto
Adapted `set_widths` because that's where there's a Term instance already.
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-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-16Add inline-hint-style option and use for side-by-side wrap symbolsDan 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-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-15Remove superfluous lowercasing of feature names. (#718)Levi Bard
Fixes #716
2021-08-28Handle blame outputDan Davison
Fixes #291, #426
2021-08-28Add default-language optionDan Davison
2021-08-20Support `insteadOf` replacements in git remote URLsDan Davison
Use libgit2 to query remote URL instead of querying remote.origin.url directly. This has the consequence that `insteadOf` replacements are honored. See https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf Fixes #693
2021-08-20Revert "Support `insteadOf` replacements in git remote URLs"Dan Davison
This reverts commit d97227ded9d465c2c8355df5f9f8f6ba1c1213e8.
2021-08-20Support `insteadOf` replacements in git remote URLsDan Davison
Use libgit2 to query remote URL instead of querying remote.origin.url directly. This has the consequence that `insteadOf` replacements are honored. See https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf Fixes #693
2021-08-20Make it possible to jump between files when navigate is active (#684)Dan Davison
* Use distinct navigate label for file and hunk boundaries Ref #680 * Make it easy to remove hunk label from navigate regex Thanks @lepotic for the suggestion. Fixes #680 * Allow regex meta characters to be used in navigate anchors
2021-08-20Fix computed values to be computed after all set_options (#690)ulwlu
* Make truecolor option honorable from gitconfig * Add test that true-color can be read from git config The new test fails before 7ed3c2c3ee494dab25fd76b220da7c716a9b731f * Place computing process after set_options * Add test for checking if values requre computing set correctly * Remove unnecessary computed values candidate Co-authored-by: Dan Davison <dandavison7@gmail.com>
2021-08-18Remove unnecessary borrows (#692)Ben Armstead
2021-07-10Clippy: don't nest module inside module with same nameDan Davison
2021-06-09Add pager option for customizing pager without environment variables (#627)Kangwook Lee (이강욱)
* Add pager option * Use config.pager for output
2021-05-25Add hyperlinks-commit-link-format option (#614)Dan Davison
* Refactor: hyperlinks utility * Add hyperlinks-commit-link-format option Fixes #613
2021-05-24Support custom commit line regex when parsing git output (#558)Dan Davison
Fixes #174
2021-04-24Add relative-paths optionDan Davison
2021-04-24Add --diff-stat-align-width to control alignment of relativized pathsDan Davison
2021-04-23Deprecate --24-bit-color, replacing with --true-color (#571)Dan Davison
Fixes #567
2021-04-15CI: check docs (#559)Marco Ieni
* CI: check docs * Don't use triple-slash doc comments A full pass would need to be done to make the comments suitable for generating documentation. Co-authored-by: Dan Davison <dandavison7@gmail.com>
2021-03-20Skeleton for show-themes command line optionCatherine Noll
2021-01-08Create git_config moduleDan Davison
2020-12-31Add styles for file path and line number in hunk headerDan Davison
Fixes #481
2020-12-27Revert "Interpret `line-numbers = false` in gitconfig as no line numbers at ↵Dan Davison
all (#296)" This reverts commit ecb2da1e271aa0daa6dd2ed4c6658d59347020e6.
2020-12-08Make commit style to be colored with same structure while color_only #405 (#438)ulwlu
* Remove force assing raw to commit style when color_only * Add test for commit style color when color_only
2020-12-08Make hunk header style to be colored with same structure while color_only ↵ulwlu
#405 (#437) * Remove force passing raw to hunk header style when color_only * Handle hunk header color when color_only * Add test for hunk header style color when color_only * Delete fixme because it actually is required * Add comment for condition that keeps structure when color_only and raw mode
2020-12-08Make file style to be colored with same structure while color_only #405 (#436)ulwlu
* Add config property of color_only * Delete force assign raw to file_style when color_only * Print filemeta in color with rawline when color_only mode * Cargo fmt * Add test if file_style with color_only has style * Add comment about color_only
2020-12-05Expose line-buffer-size as a new option (#429)Dan Davison
Fixes #427
2020-11-22Handle copied filesDan Davison
Fixes #392
2020-11-22Fix diff interactivefilter when decoration option is enabled (#367)ulwlu
* Add test for diffInteractiveFilter for all options * Disable **-decoration-style when color-only * Edit color-only one-to-one test cases Co-authored-by: ryuta69 <eyma22s.yu@gmail.com> Co-authored-by: Dan Davison <dandavison7@gmail.com>
2020-11-14Rename directory: src/bat -> src/bat_utilsDan Davison
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-09-18Fix `git add -p` to work when any options enabled (#323)ryuta69
* Add test for input and output for diff interactive filter * Add color_only in config struct * Refactor should_handle false when color_only and FileMeta, CommitMeta * Refactor handle_hunk_header_line to show raw_text with color_format when color_only * Fix indent * Revert the logic changes for interactive filter * Add color only workaround in set options * Add more test patterns for diff interactive fillter
2020-09-03Hack: env var for boolean flagDan Davison
The proper way would be using env = "DELTA_NAVIGATE", but see https://github.com/clap-rs/clap/issues/1476 https://github.com/TeXitoi/structopt/issues/372 Doing it as in this commit probably has drawbacks, e.g. related to whether the argument is recorded as having been supplied.
2020-08-20Interpret `line-numbers = false` in gitconfig as no line numbers at all (#296)Dan Davison
Fixes #292
2020-08-15RearrangeDan Davison
2020-08-14Add new option to show-config and test of gitconfigDan Davison