cm_EditNewFile 1: create a new file, but do not open the editor

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

cm_EditNewFile 1: create a new file, but do not open the editor

Post by *Stefan2 »

Hello Christian,

I want to remind on this often need feature.


Additionally to
cm_EditNewFile >> Create+Open new text file

I would like to suggest a parameter
cm_EditNewFile 1 >> Create new text file, but do not open the editor






 
User avatar
Hacker
Moderator
Moderator
Posts: 13073
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *Hacker »

Support++.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *Stefan2 »

This is implemented now, many thanks to Mr. Ghisler.
https://www.ghisler.com/history1100.txt
10.05.23 Release Total Commander 11.00 beta 2
07.05.23 Added: cm_EditNewFile with parameter 1 now creates a new file without opening the editor.
Uploads new file to ftp or file system plugin if it doesn't already exist there (32/64)

Testes on Win11 and it works for me from TC command line and also from an button.


SYNTAX
-- "cm_EditNewFile" is the internal command to open an existing file in the configured editor (F4), and first create the file, if not already present.
-- Use "cm_EditNewFile 1" to create a new text file, but don't open it instantly in the configured editor.

Most useful for myself too, for to create new text files just as notice, now w/o the need to close the disturbing popping up editor.





ATTENTION
2ghisler(Author)
"cm_EditNewFile 1" used on an existing file will open the dialog ,
pre-filled with the name of the existing file as usual,
but does nothing after clicking on the [OK]-button.

It works as designed. But maybe you want to ignore the "1"-parameter if used on an already existing file?
That would prevent the need to create two buttons // use two commands for to work with the files.



 
User avatar
beb
Senior Member
Senior Member
Posts: 436
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *beb »

Don't they just look like the sister threads by now?:
viewtopic.php?t=78852 [here]
viewtopic.php?t=78958 [there]
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *Stefan2 »

beb wrote: 2023-05-10, 16:25 UTC Don't they just look like the sister threads by now?:
viewtopic.php?t=78852 [here]
viewtopic.php?t=78958 [there]
No, only because in both its about the same internal base command.

[here] >> suggestions for >>>>>> "cm_EditNewFile 1"
[there] >> another suggestions > "cm_EditNewFile file1.txt|file2.txt|file3.txt"



 
User avatar
beb
Senior Member
Senior Member
Posts: 436
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *beb »

2Stefan2
Roger.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: cm_EditNewFile 1: create a new file, but do not open the editor

Post by *Stefan2 »

2ghisler(Author)

can this please become adjusted?

"cm_EditNewFile 1"
> if the entered filename doesn't exist yet, created it but don't open the editor (due to the '1') >> implemented
> if the entered // pre-filled-suggested filename already exist, just open it for editing >> this doesn't work right now


Thank you



 
Post Reply