@@ -13,6 +13,7 @@ use clap::ArgMatches;
1313
1414use console::Term;
1515
16+use crate::input::{new_file_input, new_stdin_input};
1617use bat::{
1718 assets::HighlightingAssets,
1819 config::{Config, VisibleLines},
@@ -257,8 +258,9 @@ impl App {
257258 let files: Option<Vec<&OsStr>> = self.matches.values_of_os("FILE").map(|vs| vs.collect());
258259
259260 if files.is_none() {
260− let input = Input::stdin_as_file(filenames_or_none.next().unwrap_or(None));
261− return Ok(vec![input]);
261+ return Ok(vec![new_stdin_input(
262+ filenames_or_none.next().unwrap_or(None),
263+ )]);
262264 }
263265 let files_or_none: Box<dyn Iterator<Item = _>> = match files {
264266 Some(ref files) => Box::new(files.iter().map(|name| Some(*name))),
@@ -269,9 +271,9 @@ impl App {
269271 for (filepath, provided_name) in files_or_none.zip(filenames_or_none) {
270272 if let Some(filepath) = filepath {
271273 if filepath.to_str().unwrap_or_default() == "-" {
272− file_input.push(Input::stdin_as_file(provided_name));
274+ file_input.push(new_stdin_input(provided_name));
273275 } else {
274− file_input.push(Input::ordinary_file(filepath).with_name(provided_name));
276+ file_input.push(new_file_input(filepath, provided_name));
275277 }
276278 }
277279 }