fix #47
All checks were successful
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 43s

This commit is contained in:
2026-01-27 14:50:05 -07:00
parent 077b53f6ff
commit b3b2c59a36
3 changed files with 13 additions and 6 deletions

View File

@@ -353,7 +353,7 @@ fn copy_paste_y_locked_var() {
}
#[test]
fn issue_47() {
fn copy_paste_var_in_function() {
let mut app = App::new();
app.grid.set_cell("A0", 4.to_string());
Mode::process_key(&mut app, 'j');

View File

@@ -63,7 +63,7 @@ impl CellType {
CellType::Equation(eq) => {
// Populate the context
let ctx = ExtractionContext::new();
let _ = eval_with_context(eq, &ctx);
let _ = eval_with_context(&eq[1..], &ctx);
let mut equation = eq.clone();
// translate standard vars A0 -> A1

View File

@@ -276,11 +276,19 @@ impl ExtractionContext {
}
}
pub fn dump_vars(&self) -> Vec<String> {
if let Ok(r) = self.var_registry.read() { r.clone() } else { Vec::new() }
if let Ok(r) = self.var_registry.read() {
r.clone()
} else {
Vec::new()
}
}
#[allow(dead_code)]
pub fn dump_fns(&self) -> Vec<String> {
if let Ok(r) = self.fn_registry.read() { r.clone() } else { Vec::new() }
if let Ok(r) = self.fn_registry.read() {
r.clone()
} else {
Vec::new()
}
}
}
@@ -308,8 +316,7 @@ impl Context for ExtractionContext {
} else {
panic!("The RwLock should always be write-able")
}
// Ok(Value::Int(1))
unimplemented!("Extracting function identifier not implemented yet")
Ok(Value::Int(1))
}
fn are_builtin_functions_disabled(&self) -> bool {