mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-25 03:06:53 -06:00
This commit is contained in:
@@ -325,6 +325,8 @@ pub fn editor_widget(app: &mut SheetApp, ui: &mut egui::Ui, id: egui::Id, font:
|
||||
ed.completion = crate::editor::column_completion(sh, ed.cell, &ed.text);
|
||||
}
|
||||
ed.point = None;
|
||||
// Typing ends the pointing: the next arrow starts again from the edited cell, as in Excel.
|
||||
ed.point_cell = None;
|
||||
let names: Vec<String> = function_names()
|
||||
.iter()
|
||||
.map(|name| {
|
||||
|
||||
@@ -159,3 +159,20 @@ fn formula_point_drag_keeps_the_sheet_qualifier() {
|
||||
h.state_mut().session.execute("sheet.activate", json!({"sheet": "Sheet1"})).unwrap();
|
||||
assert_eq!(cells(&h), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn formula_arrow_pointing_restarts_from_the_edited_cell_after_typing() {
|
||||
let mut h = harness("B4");
|
||||
h.state_mut().begin_edit(Some("=".into()), false);
|
||||
h.run_steps(2);
|
||||
h.key_press(egui::Key::ArrowUp);
|
||||
h.run_steps(1);
|
||||
h.key_press(egui::Key::ArrowUp);
|
||||
h.run_steps(1);
|
||||
assert_eq!(h.state().editor.as_ref().unwrap().text, "=B2");
|
||||
frame(&mut h, Event::Text("+".into()));
|
||||
h.run_steps(1);
|
||||
h.key_press(egui::Key::ArrowUp);
|
||||
h.run_steps(1);
|
||||
assert_eq!(h.state().editor.as_ref().unwrap().text, "=B2+B3");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user