summaryrefslogtreecommitdiff
path: root/src/format.rs
AgeCommit message (Collapse)Author
2024-11-29clippy 1.83: apply explicit lifetimes elisions suggestionsThomas Otto
2024-02-19Accept clippy suggestions (#1632)Dan Davison
2023-02-28Fix clippy warnings (#1298)nickelc
* 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`
2022-08-16Fix clippy warnings after rust 1.63 upgrademliszcz
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.
2022-08-07Fix typos (#1151)Kian-Meng Ang
Found via following command: codespell -L crate,nin,numer,struc,ded,fo
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-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.
2021-11-15Support precision specifier in run-time format stringsDan Davison
2021-10-26Fix side-by-side mode without line numbersThomas 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-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-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-16Add line number width calculationThomas Otto
2021-08-28Refactor: module for working with format stringsDan Davison
2021-08-28Refactor: eliminate format moduleDan Davison
2020-11-07remove some clippy warnings (#383)Marco Ieni
* remove some clippy warnings * revert comparison_chain clippy lint Allow it locally
2020-07-22Format files and commits as OSC 8 hyperlinksDan Davison
Closes #257