Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic formula format setting as the current "automatically format grid formulas" setting does not do the job #71

Open
uahnbu opened this issue Nov 22, 2023 · 2 comments

Comments

@uahnbu
Copy link

uahnbu commented Nov 22, 2023

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.
@jack-williams
Copy link
Contributor

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?

@uahnbu
Copy link
Author

uahnbu commented Nov 24, 2023

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants