Skip to main content

spawn_highlighter

Function spawn_highlighter 

Source
pub fn spawn_highlighter(
    document: &DiffDocument,
    repo: Option<Repository>,
    output: impl Fn(HighlightOutput) + Send + 'static,
) -> Highlighter
Expand description

Spawns a background highlighter for document.

output is invoked on the worker thread for each produced HighlightOutput; forward it to the UI thread (for example over a channel) and apply it to the viewer.