Sigil

Code edit

A code editor with built-in text_edit editing.

GUITUIRuns in the browsercode_edit

Preview

Code edit, Default, light themeCode edit, Default, dark theme

Usage example

fn code_edit_demo() -> CodeEditBuilder {    let lines = vec![        String::from("fn main() {"),        String::from("    println!(\"hi\");"),        String::from("}"),    ];    code_edit(signal(lines), signal((1, 4)))}
fn code_edit_demo() -> CodeEditBuilder {  let lines = vec![    String::from("fn main() {"),    String::from(      "    println!(\"hi\");",    ),    String::from("}"),  ];  code_edit(    signal(lines),    signal((1, 4)),  )}

States

All 4 captured states, each drawn by the window host and by the terminal host.

  • Code edit, Default, light themeCode edit, Default, dark theme
    Default
  • Code edit, Hover, light themeCode edit, Hover, dark theme
    Hover
  • Code edit, Focused, light themeCode edit, Focused, dark theme
    Focused
  • Code edit, Disabled, light themeCode edit, Disabled, dark theme
    Disabled

API

NameSignaturePurpose
code_editfn code_edit(lines: Signal<Vec<String>>, caret: Signal<(usize, usize)>) -> CodeEditBuilderA code editor with built-in text_edit editing.