andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.88k stars 208 forks source link

Recalc avg on fcopy #874

Open cskeeters opened 5 months ago

cskeeters commented 5 months ago

A cell with @avg isn't recalculated when a cell included in it's range is modified as a result of :fcopy.

Start with the following file, recalc.sc.

# This data file was generated by the Spreadsheet Calculator Improvised (sc-im)
# You almost certainly shouldn't edit it.

newsheet "recalc"
movetosheet "recalc"
offscr_sc_cols 0
offscr_sc_rows 0
nb_frozen_rows 0
nb_frozen_cols 0
nb_frozen_screenrows 0
nb_frozen_screencols 0
let A0 = 2
let B0 = A0
let A1 = 1000
let B2 = @avg(B0:B1)
goto B0

Then enter gob0:fcopy. Notice B2 (avg) doesn't update unless you move to that cell and press @ or open and reclose. I have autocalc set, so I would expect this to update automatically after fcopy.

If I go to b2 and press @, it will update. Is there a way to recalculate the entire sheet without saving, closing, and reopening?