mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-08 00:44:30 +01:00
PR comments addressed for line range +delta syntax
This commit is contained in:
parent
0748783404
commit
c86a179412
@ -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 New Issue
Block a user