mirror of
https://github.com/sharkdp/bat
synced 2024-11-14 16:17:20 +00:00
PR comments addressed for line range +delta syntax
This commit is contained in:
parent
0748783404
commit
c86a179412
2 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
## Features
|
||||
|
||||
- `$BAT_CONFIG_DIR` is now a recognized environment variable. It has precedence over `$XDG_CONFIG_HOME`, see #1727 (@billrisher)
|
||||
- Support for `x:+x` syntax in line ranges (e.g. `20:+10`). See #1810 (@bojan88)
|
||||
- Support for `x:+delta` syntax in line ranges (e.g. `20:+10`). See #1810 (@bojan88)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ impl LineRange {
|
|||
2 => {
|
||||
new_range.lower = line_numbers[0].parse()?;
|
||||
|
||||
new_range.upper = if line_numbers[1].bytes().next().unwrap() == b'+' {
|
||||
new_range.upper = if line_numbers[1].bytes().next() == Some(b'+') {
|
||||
let more_lines = &line_numbers[1][1..]
|
||||
.parse()
|
||||
.map_err(|_| "Invalid line number after +")?;
|
||||
.map_err(|_| "Invalid character after +")?;
|
||||
new_range.lower + more_lines
|
||||
} else {
|
||||
line_numbers[1].parse()?
|
||||
|
|
Loading…
Reference in a new issue