Formula Formatting - WE HAVE NEWLINES

Code Function Writers Rejoice!

The devs have granted us a gift and introduced newlines in formula functions! Although I believe this is just the first step in a number of necessary features for writing complex formulas, it is certainly a welcomed one!

How do I do it?? Just use SHIFT + ENTER while writing a formula.

Why would I need such a thing?? Coda is designed to allow complex environments designed by their users. The more complicated the environments, the more complex the formulas. The real issue isn’t really with writing formulas (although still complicated…), it has more to do with maintenance. When coming back to a complex formula written months, weeks, or even just days ago, it can be hard to remember what it does, and particularly hard to remember how it does it. Also useful, is to note why you wrote it…

Here is an example of using newlines to make things clearer:

Before


After

PS - Yes, I stitched together multiple photos to make the “after” photo… Give me larger edit areas!

Things that are still necessary to make the formula writing and maintenance process manageable:

  • Inline comments # Because of course we do!
  • Custom (larger…?) formula-writing box… It is entirely too small right now
    • (Doesn’t my stitched-together photo above look so pretty?)
  • Longer variable cells so I can see the names of my variables!
    • (See: "Var - Console - Toggle Pe…? above…)

Thanks for the constant improvements!

Lloyd

12 Likes

+1 these are easy to implement and would provide huge benefit to the user

Coda just broke this for the regular formula editor. Shift-enter closes the dialogue rather than creating a new line (it still works normally on the expanded coda editor). What’s the best way to tell Coda about this issue?

i ALWAYS press control_shift_E in my formulas to get the ‘expanded’ editor, and i ALWAYS click on ‘auto format’ when looking at a scrunched-up formula.

that way i get a nice big editing space with newlines and indenting which makes the formula so much CLEARER.

it amazing how much it reduces bugs and mental fatigue. especially if you are working on Coda all day.

i have set up my own special keyboard shortcut for this using AHK but ctl-shft-E is the thing to remember

max

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.