Skip to main content

edit

Function edit 

Source
pub fn edit(
    filename: &str,
    initial_content: &str,
    mode: EditorMode,
) -> Result<Option<String>>
Expand description

Open the built-in TUI editor with initial content.

  • filename is shown in the UI (doesn’t touch disk).
  • initial_content is pre-loaded into the buffer.
  • mode controls wrapping and guide lines.

Returns Some(content) if the user saved, None if cancelled.