microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
113 stars 11 forks source link

Grid edit formula bug #29

Closed ammosov closed 1 year ago

ammosov commented 1 year ago

Start with:

image

Editing to -

image

Returning to normal edit mode

image

Going to formula edit mode:

image

UNDO is not available. Copy and paste restores back to original state OK. Entering the very same syntax by hand works normally.

jack-williams commented 1 year ago

Just to confirm my understanding: the issue is that the function arguments box is not displaying the formulas for the arguments? The expected behavior is for the MEDIAN formula to appear there?

ammosov commented 1 year ago

I would say, the formula in the cell is expected to remain visible and editable using either of the methods - conventional Excel and AFE grid editor. It appears that once edited with AFE, it becomes editable only as AFE object, and somehow obfuscated or otherwise becomes uneditable in basic edit way.

ammosov commented 1 year ago

UPD. I discovered by trial and error that the formula is still there in Basic Edit Mode but all spaces are passed to it too. So you can edit it but you cannot see more than a few letters at once - a function name, an argument or any other part of it on one line in AFE editor.

jack-williams commented 1 year ago

The underlying behavior causing the problem is that we emit the formula with line-breaks. You can expand the formula bar to see the full formula: image

That being said, I can see how that is still undesirable and the preferred behavior is to emit on a single line. We are tracking this in #28.

Regarding the specific issue of the Function Arguments dialog, I believe this is an issue with Excel and not AFE. If I create a multi-line formula in a workbook without AFE, such as:

=SUM(
1,
2
)

and open the insert function box, I similarly see no arguments. EDIT as I have also discovered, it is there but hidden!

I hope that by saving the formulas in the cell as a single line this will solve the problem.

ammosov commented 1 year ago

Yes, this seems to be what I discovered, too. Otherwise, AFE would be my preferred edit more from now on. It would be nice if extra spaces/line breaks were trimmed for basic edit more and restored for AFE mode.

jack-williams commented 1 year ago

Great, I'll close this issue as a duplicate of #28. When that is closed, I expect the behavior will be: