PremierLangage / premierlangage

Server for auto-evaluating exercices
Other
18 stars 9 forks source link

[BUG] Files created in the editor always have an extra empty line at the end #433

Closed fwjmath closed 3 years ago

fwjmath commented 3 years ago

Description

When we create a file in the editor, it always comes with an extra empty line at the end, even when we don't want it. This leads to problems when we want to control precisely the behavior of a file (e.g., Python exercices for files), so that we reproduce on PL what we have on our own machine.

How to reproduce

  1. Create an empty file in the editor, it should be automatically opened, and we already see that it contains two empty lines.
  2. Delete one of the lines, save the file, and close it.
  3. Reopen the file.

Expected behavior

The file should contain only one empty line (completely empty file).

Actual behavior

The file now contains two empty lines (so one '\n').

nimdanor commented 3 years ago

Si pull request #443