New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *DrShark »

If we set the empty line as path to F4 Editor in Total Commander configuration, TC internally replaces it with "none"
string, so when we use Shft+F4 in filelist Total Commander creates a new file and then tries to open in some editor called "none", which by default on Windows doesn't exist, so TC shows an error:

Code: Select all

---------------------------
Total Commander
---------------------------
File not found!
none 

"Не удается найти указанный файл."
---------------------------
OK
---------------------------
The new file is actually created though, but Total Commander doesn not show it in filelist even after pressing OK in above error message.
Only after refreshing the panel e.g. with Crtl+R new file appears there.

I think more expected behavior here world be to auto-refresh file list just after actual new file creation happened to show it there, even before TC will show mentioned error.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *petermad »

Or the file should not be created at all, when editor is set to "none".
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *DrShark »

petermad wrote: 2021-07-03, 15:02 UTC Or the file should not be created at all, when editor is set to "none".
I think TC should create the file, it's a main goal of Shift+F4 function while opening in editor is a bonus feature (which sometimes is not needed because user then wasting time closing the editor window, and some users would even prefer so TC would never even try to open newly created file in editor). The error message can be easily closed with Esc key.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *ghisler(Author) »

How about this: If the editor is set to none, then Shift+F4 could just create the file without trying to open it?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *petermad »

2ghisler(Author)
If the editor is set to none, then Shift+F4 could just create the file without trying to open it?
That is fine too - but then a message that the file is created would be nice, since the new file might not even be visible in the shown part of the current directory - or better jump to the new file in the file panel (that would actually also be nice if there is an editor configured to open the file).
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *ghisler(Author) »

Yes, jumping to the file is a very good idea, I will add that too.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *DrShark »

ghisler(Author) wrote: 2021-07-05, 09:21 UTC How about this: If the editor is set to none, then Shift+F4 could just create the file without trying to open it?
Since techincally "none" is a possible name of editor's binary, I think TC should check whether an executable with name "none" exists in locations set in %PATH% and only if is not there assume the editor is not set by user.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Stefan2
Power Member
Power Member
Posts: 4124
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *Stefan2 »

DrShark wrote: 2021-07-03, 10:47 UTC If we set the empty line as path to F4 Editor in Total Commander configuration, TC internally replaces it with "none"
...plus following discussion...


Maybe Mr. Ghisler could just use some other string there, like "<none>", or much better "No editor configured"


- - -
petermad wrote: 2021-07-05, 12:04 UTC 2ghisler(Author)
If the editor is set to none, then Shift+F4 could just create the file without trying to open it?
That is fine too - but then a message that the file is created would be nice, since the new file might not even be visible in the shown part of the current directory - or better jump to the new file in the file panel (that would actually also be nice if there is an editor configured to open the file).
> "or better jump to the new file in the file panel (that would actually also be nice if there is an editor configured to open the file)."

Not always.
If I am f.ex. in "C:\Windows\System32\" near the "Sysprep"-folder and
create a new file "TempNotice.txt" and TC jumps to files starting with "T",
that would also be confusing and I was loosing my position near the folders starting with an "S" and have to search for them again.

- - -

Also I want to remember on my idea, if the entered file name on Shift+F4 contains
a additional special sign, like "?" or ">", the file will be created but no editor (even configured) will be launched.
I for one often create new file that way, but do not need to open them, so it's annoying to always close them again, so I use my own script here.





 
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *DrShark »

Stefan2 wrote: 2021-08-16, 13:04 UTC
DrShark wrote: 2021-07-03, 10:47 UTCIf we set the empty line as path to F4 Editor in Total Commander configuration, TC internally replaces it with "none"
...plus following discussion...

Maybe Mr. Ghisler could just use some other string there, like "<none>", or much better "No editor configured"
Well, my remark was more in sake of backward compatibility, so I don't see urgent reason to change that string.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *ghisler(Author) »

I have added this now to Total Commander 10.50 beta, please try it!
ghisler(Author) wrote: 2021-07-05, 09:21 UTC How about this: If the editor is set to none, then Shift+F4 could just create the file without trying to open it?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4576
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *white »

Tested OK using TC10.50b2 32bit and 64bit.

Question: In case an external editor is defined, why not also refresh the list and go to the file before launching the editor?



Edited: I think ghisler(Author) mistakenly clicked the edit button instead of the quote button and changed this post to include:
Question: In case an external editor is defined, why not also refresh the list and go to the file before launching the editor?
Because there is no need, and the user may prefer to keep doing what he was (e.g. selecting files)?
User avatar
white
Power Member
Power Member
Posts: 4576
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: New file created with Shift+F4 not shown until manual refresh in filelist if editor is not defined

Post by *white »

ghisler(Author) wrote:
white wrote: 2022-04-26, 17:43 UTCQuestion: In case an external editor is defined, why not also refresh the list and go to the file before launching the editor?
Because there is no need, and the user may prefer to keep doing what he was (e.g. selecting files)?
Unlikely, not intuitive and inconsistent.
Post Reply