Opened 4 years ago

Last modified 3 years ago

#1027 reopened enhancement

save file with .pl extension by default?

Reported by: szabgab Owned by: waxhead
Priority: major Milestone:
Component: Basic Editor Features Version: 0.72
Keywords: Cc:

Description

One of the issues I regulary see in my classes that when people write their first perl script in Padre and save it, they don't give an extension to it. In turn Padre does not recognize the file as a Perl script. If they open the file again Padre recognizes the mime-type as the file starts with the sh-bang but there might be a bug in Padre (or maybe it is already fixed) regarding the issue of Padre forgetting the mime-type on save.

In addition I think we should address the expectation of the Windows people that Padre would save the file using the "standard" extension of the language or at least it should warn them about the missing extension.

Change History (6)

comment:1 Changed 4 years ago by waxhead

  • Owner set to waxhead
  • Status changed from new to assigned

Personally I think it should warn them about the lack of a file extension, rather than put one on by default.

Older versions of notepad I think does this, and you end up with something like myscript.pl.txt, which is really annoying.

comment:2 Changed 4 years ago by waxhead

OK, I have now added something along these lines in r13582, but rather than default, it will warn a user they are saving a file without a file extension, and offer suitable extensions based on the mimetype information in Padre.

comment:3 Changed 3 years ago by waxhead

  • Resolution set to fixed
  • Status changed from assigned to closed

Marking this one fixed, it's not what was requested, but it should work close to what was intended.

Feel free to reopen if it's not what you wanted.

comment:4 Changed 3 years ago by zenogantner

  • Resolution fixed deleted
  • Status changed from closed to reopened

The current fix for this ticket makes it hard to save files without extensions, e.g. NOTES or README.

Maybe we should check whether the contents of a file really are Perl code before showing such a dialog.

Also, having "yes" and "no" as possible answers does not make sense - both answers lead you back to the file dialog.

comment:5 Changed 3 years ago by waxhead

The dialog was broken in the first release, it was reported here by Sewi: #1095.

I fixed the mistake with the "Yes" "No", but after discussion on #padre tonight, it was felt that the dialog should come out altogether and a better dialog that covers the "Do not ask me again" option.

comment:6 Changed 3 years ago by szabgab

  • Component changed from editor to Basic Editor Capabilities
Note: See TracTickets for help on using tickets.