@@ -11,7 +11,7 @@ use path_abs::PathAbs;
1111
1212use crate::bat_warning;
1313use crate::error::*;
14−use crate::input::{InputReader, OpenedInput, OpenedInputKind};
14+use crate::input::{InputReader, OpenedInput};
1515use crate::syntax_mapping::{MappingTarget, SyntaxMapping};
1616
1717use ignored_suffixes::*;
@@ -198,18 +198,7 @@ impl HighlightingAssets {
198198 .ok_or_else(|| Error::UnknownSyntax(language.to_owned()));
199199 }
200200
201− // Get the path of the file:
202− // If this was set by the metadata, that will take priority.
203− // If it wasn't, it will use the real file path (if available).
204− let path = input
205− .metadata
206− .user_provided_name
207− .as_ref()
208− .or_else(|| match input.kind {
209− OpenedInputKind::OrdinaryFile(ref path) => Some(path),
210− _ => None,
211− });
212−
201+ let path = input.path();
213202 let path_syntax = if let Some(path) = path {
214203 // If a path was provided, we try and detect the syntax based on extension mappings.
215204 match mapping.get_syntax_for(