Total Commander Edit Redirector

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

And I completely forgot that I still have not published the fixed version… :( Sorry about that, I'll try to find time and do it.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

Version 1.4.2.0: Added support for calling from Sync Dirs dialog (as well as modal Find Files, which was implemented in the test version 1.4.1.0).

32-bit version (25 Kb) / mirror
32-bit no-SSE version (25 Kb) / mirror (for old processors)
64-bit version (26 Kb) / mirror
Source code (C++) (42 Kb) / mirror / repository
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
KozakMak
Senior Member
Senior Member
Posts: 352
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: Total Commander Edit Redirector

Post by *KozakMak »

when to expect support of cm_Edit /N="%COMMANDER_INI%" ?
OS: Win10 | TC: latest x64
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

I can't say, unfortunately, I'm quite busy currently and didn't have time to properly get to know the new command features.

The thing is, the program was never intended to be used like that, and I need to find out how to distinguish TCER being started via this command from just pressing F4. At the moment I'm not even sure it's possible…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: Total Commander Edit Redirector

Post by *kesdoputr »

Hello, i change from F4Menu to tcer for a while and it works great, today i try the new Total Commander 11.03 rc1 which have the new feature that
- Lister: Press F4 to open currently viewed file in user-defined editor
When i press F3 on a txt file to open it with TC's lister, then i press F4, i will get the error window below
Image: https://i.imgur.com/VcrGZFd.png

Is there will be a update for the TC's new feature? Thanks for your reply :D
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

I need to adjust TCER to make that feature work. I definitely plan to add this (especially since I'm using TCER myself), but unfortunately I cannot make any promises on when it's going to be implemented.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: Total Commander Edit Redirector

Post by *kesdoputr »

Thanks for your reply, just a report with 11.03RC2 that
22.01.24 Added: Option how to handle F4 in lister: wincmd.ini [Lister] F4Edit=1 0=disabled, 1=open editor, 2=like 1, but close Lister when viewing only one file, 3=like 2, but also when viewing multiple files (32/64)
Just when F4Edit=1 will get the error like i post before.
When use F4Edit=2、3,tcer works great.
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

Interesting. It means, TC first closes the viewer, then starts the editor.
But it's still may not do what you expect, because TCER doesn't know it was called from Lister, and will open the files selected in the TC file panel instead of the file that you were viewing. Only if you happen to not have any selection, and the cursor remains on the file you pressed F3 on, the same file will be opened in the editor.

In fact, I expect that in the modes 2/3 I won't even be able to make TCER work properly, since I have no information about where exactly F4 was pressed. I can only see what arguments TCER was started with, and the currently active window. So in F4Edit=2/3 I can't determine what I should open: the single file or the selected files.

Same problem with cm_Edit /N, by the way…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Total Commander Edit Redirector

Post by *ghisler(Author) »

I see - then TCER will have to be updated to detect whether the calling window is Total Commander or not. Personally I'm using OpenFileTC, which doesn't support the opening of multiple selected files, so it doesn't have this problem.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: Total Commander Edit Redirector

Post by *Flint »

ghisler(Author) wrote: 2024-01-25, 08:36 UTC then TCER will have to be updated to detect whether the calling window is Total Commander or not.
Exactly. That's why it's failing currently: originally I never expected it to be called from outside of TC's main window, because the main idea behind TCER is opening the selected files. So I added these failchecks, to inform the users when the selected files can't be obtained. Later I had to fix this to support calling from the Find Files and SyncDirs window; now I need to also add Lister.

But the main question for me is, how to distinguish the way TCER was started. If F4Edit=2, then pressing F4 in TC panels, and pressing F4 in Lister result in virtually identical environments for the started editor, there will be no way to find out that F4 was pressed from Lister (as it's already closed by the time TCER is launched). Do you think you could introduce some difference; maybe pass an extra environment variable into the started editor's environment block, which would contain a value, defining the particular type of the editor call? Then the proxy-editor authors could easily recognize all the scenarios.

For example, a variable named %COMMANDER_EDITOR_SRC%, which would contain one of the possible values:
main, if the editor was called from the main TC panels;
sync, if it was called from SyncDirs;
find, if from Find Files;
lister, if from Lister;
cmd, if called via cm_Edit.
I think that would cover it.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Total Commander Edit Redirector

Post by *ghisler(Author) »

In RC3, I will add a new value to wincmd.ini so you can configure a different editor for F4 in Lister:
wincmd.ini
[Lister]
Editor=your_editor.exe "%1"
It will work the same as the one in [Configuration], and Total Commander will still use the default one if the new isn't configured.
Author of Total Commander
https://www.ghisler.com
Post Reply