Open lilyball opened 3 years ago
Thank you for reporting this.
Just to make sure: did you see the --wrap
option? The following should hopefully work fine:
--style=header,grid,snip --wrap=never
I did notice that option after filing this issue I set it in my config because it disables soft wrapping in less
as well (though I can re-enable it interactively with -S
). And if I work around that, then this will probably confuse me the next time I try bat --style=full
.
Just wanted to add that this same issue bothers me.
My issue with --wrap=never
is that it triggers the pager interactively when lines are too long, whereas without it, the paging is only activated automatically when there are enough lines.
The reason I want to disable wrapping without this side-effect is because I don't like having to remove the newlines when copy-pasting (or having to switch to cat
once I realize they're there).
Ex: Using --style="rule,snip"
in my config when running bat .ssh/id_rsa.pub
causes hard wrapping, whereas --style="plain"
works perfectly even though rule
and snip
aren't even applicable for that invocation of the command, since it's only one file with no given line range.
Describe the bug you encountered:
bat
will soft-wrap text if I use--style=plain
, meaning resizing the window works, copying wrapped lines works correctly, and jumping to a specific line inless
works. But it hard-wraps if I enable any decorations, even if the decorations don't affect the horizontal layout. This is really frustrating. Even if I don't want to resize the window, the fact that it breaks copying of wrapped lines (by inserting a newline) is a problem, and the fact that I can't jump to a given line (taking header height into account) inless
is annoying too.This happens even if the decoration in question isn't affecting output, such as
bat --style=snip
without setting line ranges. Or if the decoration is completely unaffected by window width, such asbat --style=header
What did you expect to happen instead?
Bat should soft-wrap any line whose layout is not dependent upon decorations. I believe right now that means it should soft-wrap as long as I did not enable the
numbers
orchanges
decorations. Or to put it another way, if there's no gutter, or equivalently if thegrid
decoration would not draw a vertical line, then it should soft-wrap.How annoying is this?
It's annoying enough that I have
--style=plain
in my config, even though I'd really prefer to have something like--style=header,grid,snip
. But copying of wrapped lines and jumping to line numbers inless
are both so important that I have no choice.How did you install
bat
?Nix
bat version and environment
Software version
bat 0.18.0
Operating system
Darwin 20.5.0
Command-line
Environment variables
Config file
Compile time information
Less version