The following sentences are from hypothetical manual for some text editor:

  1. To reformat the code on file save, use the "Autoformat" feature.
  2. To reformat the code when the file is saved, use the "Autoformat" feature.
  3. To reformat the code when saving the file, use the "Autoformat" feature.

Which sentence sounds more natural? I tried to find some examples on Google to make my own initial research, but all the examples that I have found are from sites that are not really creditable.

  • 1
    All are okay, really. "On save" is a familiar usage. But there's no harm in the other two, which are even clearer. (Note: #2 makes it most clear that reformatting happens in response to saving.) Commented Oct 17, 2021 at 21:18

1 Answer 1


Option 3 ("when saving the file") sounds the most natural to me.

Strictly speaking this implies that the user who is saving the file is the one doing the reformatting; to be completely correct it should be "To have the code reformatted when saving...." But this is unnecessary. Option 3 on its own is perfectly fine.

Option 2 (again, in a very technical sense) more correct, because it does not imply that the user is the one reformatting the file. But it does not sound as good.

Option 1 may be acceptable depending on the exact context; the format OnAction is common in JavaScript, for example the OnClick and OnPageLoad event handlers. But it should not be used in everyday English.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .