apply_on_current_line_or_unwrap

Function apply_on_current_line_or_unwrap 

Source
fn apply_on_current_line_or_unwrap<'a, F: FnOnce(String) -> &'a str>(
    fun: F,
    default: &'a str,
) -> String
Expand description

Apply a closure to the current line or fall back to default.

Used by the smart expr mapping helpers.

In case of errors, they are notified to Nvim and a default value is returned.