INNER CODE UNIT · Rust

get_cursor_text

David-OConnor/plascad · src/gui/mod.rs:98

pub fn get_cursor_text(cursor_seq_i: Option<usize>, seq_len: usize) -> String {
    match cursor_seq_i {
        Some(p) => {
            if p <= seq_len {
                p.to_string()
                // This occurs if the cursor is on the last row, right of the last NT.
            } else {
                String::new()
            }
        }
        None => String::new(),
    }
}

/// Handle an origin change.
fn origin_change(state: &mut State, ui: &mut Ui) {
    if ui.button("Set origin").clicked() {
        state.ui.show_origin_change = !state.ui.show_origin_change;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…