advanced-formula-environment
advanced-formula-environment copied to clipboard
Add automatic formula format setting as the current "automatically format grid formulas" setting does not do the job
Currently, the "automatically format grid formulas" setting only format the formula based on the size of the editor. The format is not reflected in the cell value when applied.
There are some workarounds, but they are quite cumbersome:
- Turn off "automatically format grid formulas" and manually enter newlines.
- Copy the formatted code in the editor to the cell itself (pasting the code in the editor back to the editor itself doesn't work).
I believe there should be a separate setting for this feature:
- The "automatically format grid formulas" setting should be changed to "Word wrap".
- Add a new setting to automatically format the document when save for example.
If you disable "automatically format grid formulas" you can use Ctrl-Shift-F (or right-click "Format document") to format formulas, and these will be preserved in the Excel cell. This wont be automatic formatting, but at least saves copying and pasting.
Roughly, there seem to be a couple of dimensions of settings:
- Whether the formatting in AFE is preserved in Excel, or Excel is put onto a single line (we have this setting today).
- Whether the line width is determined by the editor size, or by a customizable character width (we do not have this).
- Whether formatting is applied on save automatically or not (we do not have this).
- Whether formatting does link breaking or word wrap. This could be viewed as a variant on specifying with width. (we do not have this).
Does this capture your requirements?
Oh thank you. Good to know about the Right Click menu, and about the Ctrl
+Shift
+F
shortcut 🤩.
The "Automatically format grid formulas" option is kinda weird. I don't think that is what the users think to be the default option (or maybe because I'm used to VSCode?). I expect whatever I see in AFE (auto-formatted or not) is saved permanently as is in the cell. Currently:
- It behaves almost exactly like what I expected: Code got formatted when the user press Save.
- It is just that the formatted code isn't reflected in the cell.
- There's no docs about the button's functionality, and the user may only know when they notice the difference → look around for the cause → try toggling the button to figure things out.
Also I guess its name is not reflecting its functionality. It should be "Automatically format editor formulas" or inspired from Chrome Devtools: "Pretty print".