andmarti1424 / sc-im

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

Please show last active sheet on open #739

Closed earthshrink closed 1 year ago

earthshrink commented 1 year ago

Synopsis

Currently sheets seem to be written to the .sc file in the order they were added, and there is not yet a way to re-order the sheets in the UI. As a result, opening the spreadsheet always results in the last added sheet being brought up, regardless of which sheet the user was working on. For example, say user was preparing annual accounts. User may start by creating the summary sheet first, listing incomes, expenses, taxes, etc. items, then work on detail sheets for each item. Ideally, the spreadsheet should subsequently open either on the first (summary) sheet, or the last active detail sheet. But there seems no way to control the open. This also affects the export commands- export with --quit_afterload always dumps the last created sheet. The --sheet= command option seems to select the initial sheet only when opening .xlsx. A reorder command for sheets would not really help, as the user may not want to push the summary sheet to last. If the --sheet option were extended to opening of .sc files, user would still have to type more for their default use.

Suggested fix

I see movetosheet commands already in the saved file. Simply appending an extra movetosheet to the active sheet at save or close, alongside the existing goto to the last active cell, suffices to ensure that the next open or export bring up the last active sheet.

andmarti1424 commented 1 year ago

Merged!