mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 09:01:56 +00:00 
			
		
		
		
	Merge pull request #2854 from eth-p/fix-line-number-wrap-off-by-one
Fix off-by-one error in line number continuation
This commit is contained in:
		@@ -7,6 +7,7 @@
 | 
				
			|||||||
- Fix long file name wrapping in header, see #2835 (@FilipRazek)
 | 
					- Fix long file name wrapping in header, see #2835 (@FilipRazek)
 | 
				
			||||||
- Fix `NO_COLOR` support, see #2767 (@acuteenvy)
 | 
					- Fix `NO_COLOR` support, see #2767 (@acuteenvy)
 | 
				
			||||||
- Fix handling of inputs with OSC ANSI escape sequences, see #2541 and #2544 (@eth-p)
 | 
					- 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
 | 
					## Other
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@ impl Decoration for LineNumberDecoration {
 | 
				
			|||||||
        _printer: &InteractivePrinter,
 | 
					        _printer: &InteractivePrinter,
 | 
				
			||||||
    ) -> DecorationText {
 | 
					    ) -> DecorationText {
 | 
				
			||||||
        if continuation {
 | 
					        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;
 | 
					                let new_width = self.cached_wrap.width + 1;
 | 
				
			||||||
                return DecorationText {
 | 
					                return DecorationText {
 | 
				
			||||||
                    text: self.color.paint(" ".repeat(new_width)).to_string(),
 | 
					                    text: self.color.paint(" ".repeat(new_width)).to_string(),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user