Skip to main content

launch_editor

Function launch_editor 

Source
pub fn launch_editor(content: &str) -> Result<Option<String>>
Expand description

Launch an editor with the given content and return the edited result.

Returns Ok(None) if the user quit without saving (content unchanged or empty). Returns Ok(Some(content)) with the new content if changes were made.

Editor preference: $VISUAL -> $EDITOR -> vi

ยงErrors

Returns an error if the temp file cannot be created/read or the editor fails to launch.