Bug 454266

Summary: Filesystem > Right-click > Create New > Text File... should not assume *.txt extension
Product: [Applications] kate Reporter: Fabio Pesari <fpesari>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: alain, christoph, waqar.17a
Priority: NOR    
Version First Reported In: 22.04.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fabio Pesari 2022-05-23 10:51:56 UTC
Hello,

right now Filesystem > Right-click > Create New > Text File... defaults to a filename with a .txt extension, selecting automatically the name of the file (and leaving .txt out of the selection).

I think this behavior is not very user-friendly, for three reasons:
1. Text files do not need an extension and indeed, creating a blank text file without an extension will open it in Normal mode
2. Kate is also used by programmers and they need to create files with all sorts of extensions (like .c, .rb, .py, .rs, etc.); removing .txt requires additional keystrokes (e.g. ctrl+k or 4 hits of the "del" key or ctrl+a before typing, etc.)
3. (my opinion) Nowadays .txt files can be replaced by .md (Markdown) files in many situations, making manual creation of files with a .txt extension useful only in few selected situations

Of course, this is a very minor UX fix, nothing serious (the Project plugin does not suffer from it) but I think a few keystrokes could be saved for what I believe to be the majority of users (i.e. people who create files with other extensions more often than they create .txt files). Thank you for reading.
Comment 1 Alain Laporte 2022-06-19 00:32:26 UTC
Tested on Kubuntu 22.04 and after built Kate from source.

Not sure to understand what is wrong with current behavior:
* when the popup to choose the filename appear, all default name is selected and you can choose the right name and extension
* when you don't specify extension, the filename is creating without extension

Maybe we can rename the "Create -> Text File..." with "Create -> Empty File..." when https://bugs.kde.org/show_bug.cgi?id=297003 will be fixed.

This behavior it is acceptable for you?
Comment 2 Christoph Cullmann 2022-06-19 00:36:50 UTC
I am not aware that we do customize these menus, they are the standard stuff provided by KIO.

I am not even sure we should start to customize this.
Comment 3 Fabio Pesari 2022-06-19 06:04:18 UTC
(In reply to Alain Laporte from comment #1)
> Tested on Kubuntu 22.04 and after built Kate from source.
> 
> Not sure to understand what is wrong with current behavior:
> * when the popup to choose the filename appear, all default name is selected
> and you can choose the right name and extension
> * when you don't specify extension, the filename is creating without
> extension
> 
> Maybe we can rename the "Create -> Text File..." with "Create -> Empty
> File..." when https://bugs.kde.org/show_bug.cgi?id=297003 will be fixed.
> 
> This behavior it is acceptable for you?

Hello Alan,

"Create -> Empty file" would surely be better than "Create -> Text file" IMHO, as in any case the "text" is implicit since there are only two kinds of files (text and binary) and nobody is surely going to create binary files with Kate :)

Still, it'd be better if .txt were not automatically appended at the end for the reasons I specified above.
Comment 4 Alain Laporte 2022-07-05 20:09:45 UTC
Fabio, now we have choice between "Text File" and "Empty File". Can I close the ticket as resolved?
Comment 5 Fabio Pesari 2022-07-06 05:08:15 UTC
Thanks Alan, sure! I still find it a bit redundant (because an empty file is a text file) but I will for sure be using "empty file"!