Skip to main content

open_source_for_path

Function open_source_for_path 

Source
pub fn open_source_for_path(
    path: &Path,
    args: &Args,
    preprocessor: Option<&Preprocessor>,
) -> Result<(Box<dyn Source>, String, Option<String>)>
Expand description

Open a single source file using the same pipeline as startup: preprocessor (if configured), live-mode wrapper (if –live).

Returns the boxed Source, the user-facing label, and any preprocess stderr that should be surfaced in the status line.

Content-type detection and the prettify wrapper are NOT applied here — they are handled at startup (or not at all on file-switch).