mirror of
https://github.com/sharkdp/bat
synced 2026-07-17 16:03:19 +00:00
cc5f782d28
* feat: add word wrapping mode for --wrap flag * Run `cargo fmt` and add CHANGELOG entry * Add word wrap tests, update manpage and shell completions - Add integration tests for word wrapping: basic word boundary breaking, fallback to character wrapping for long words, line numbers, and short lines that fit without wrapping - Update manpage to document the new 'word' wrapping mode - Update bash, fish, zsh, and PowerShell completions with 'word' option - Avoid unnecessary clone of `line_buf` when word wrap is disabled * make clippy and cargo fmt happy --------- Co-authored-by: Keith Hall <keith-hall@users.noreply.github.com>
14 lines
327 B
Rust
14 lines
327 B
Rust
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum WrappingMode {
|
|
Character,
|
|
Word,
|
|
// The bool specifies whether wrapping has been explicitly disabled by the user via --wrap=never
|
|
NoWrapping(bool),
|
|
}
|
|
|
|
impl Default for WrappingMode {
|
|
fn default() -> Self {
|
|
WrappingMode::NoWrapping(false)
|
|
}
|
|
}
|