Skip to content

Commit

Permalink
Merge pull request #2854 from eth-p/fix-line-number-wrap-off-by-one
Browse files Browse the repository at this point in the history
Fix off-by-one error in line number continuation
  • Loading branch information
sharkdp authored Feb 12, 2024
2 parents 5a2a20a + 9d77c13 commit f735120
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fix long file name wrapping in header, see #2835 (@FilipRazek)
- Fix `NO_COLOR` support, see #2767 (@acuteenvy)
- Fix handling of inputs with OSC ANSI escape sequences, see #2541 and #2544 (@eth-p)
- Fix panel width when line 10000 wraps, see #2854 (@eth-p)

## Other

Expand Down
2 changes: 1 addition & 1 deletion src/decorations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Decoration for LineNumberDecoration {
_printer: &InteractivePrinter,
) -> DecorationText {
if continuation {
if line_number > self.cached_wrap_invalid_at {
if line_number >= self.cached_wrap_invalid_at {
let new_width = self.cached_wrap.width + 1;
return DecorationText {
text: self.color.paint(" ".repeat(new_width)).to_string(),
Expand Down

0 comments on commit f735120

Please sign in to comment.