In FileEdit, when you open a problem, it uses your
default language. However, when you switch to another
language, the template is not re-generated. The
current workaround is to delete the template code
before switching because it is not possible for FileEdit to
know whether the code is what was saved or not.
My thoughts are that if the code is EXACTLY the same
as what was generated from the current language's
template, assume no code has been written. I'm
assuming the template generation code is deterministic
and repeatable (i.e. don't put timestamp into template).
All that needs to be done is to re-generate the template
when switching languages. If the template just
generated is identical to the contents of the file, start
over with the template from the new language.
This handles the case where you open a problem, then
switch to another language. It doesn't handle the case
where you start writing code, realize that another
language would be better and then switch. This case
could probably be handled with a popup ("erase code to
generate new template?").
Logged In: YES
user_id=1118984
why delete the template? All the files use different
extensions. When switching languages, just check if an
example file already exists, if not write the template.