mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-16 18:22:28 +01:00
Implementation of 'bat --diff'
This adds a new `--diff` option that can be used to only show lines close to Git changes (added/removed/modified lines). The amount of additional context can be controlled with `--diff-context=N`. closes #23
This commit is contained in:
@@ -6,7 +6,7 @@ use syntect::parsing::SyntaxReference;
|
||||
|
||||
use crate::{
|
||||
assets::HighlightingAssets,
|
||||
config::Config,
|
||||
config::{Config, VisibleLines},
|
||||
controller::Controller,
|
||||
error::Result,
|
||||
input::Input,
|
||||
@@ -205,7 +205,7 @@ impl<'a> PrettyPrinter<'a> {
|
||||
|
||||
/// Specify the lines that should be printed (default: all)
|
||||
pub fn line_ranges(&mut self, ranges: LineRanges) -> &mut Self {
|
||||
self.config.line_ranges = ranges;
|
||||
self.config.visible_lines = VisibleLines::Ranges(ranges);
|
||||
self
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user