F4 from Lister to Editor

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
matta
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-19, 12:47 UTC

F4 from Lister to Editor

Post by *matta »

Hello,
I've been using TC for a great deal of years and still catching myself trying to use F4 in Lister to edit the current file.
At some point I used AHK for that.
Would it be possible to add such a feature to the next release?

Regards,
Matta
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: F4 from Lister to Editor

Post by *white »

Moderator message from: white » 2022-05-24, 12:46 UTC

Moved to Suggestions forum
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: F4 from Lister to Editor

Post by *Horst.Epp »

Edit is not general usefull as it is not the same for different file formats.
I guess that will never be a native TC function.
If you mean edit while viewing source files,
it can be done using the CudaLister plugin.
This allows to change from read-only to write mode while viewing.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: F4 from Lister to Editor

Post by *Hacker »

Horst.Epp,
Edit is not general usefull as it is not the same for different file formats.
Edit (F4) is always the same (F4 always calls the same editor) regardless of file format.

I support adding F4 as a hotkey that would call the editor defined for F4 with the file currently opened in Lister (perhaps adding an option to specify line and column as command line options when the editor is called from the Lister, and an option to auto-close the Lister).

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
matta
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-19, 12:47 UTC

Re: F4 from Lister to Editor

Post by *matta »

Exactly. Lister's F4 could use the standard TC handler for that.
That was the way I was using it with AutoHotKey - just ran the N++ I had assigned for F4 in TC.
I'm not willing to use AHK on current machine however.

AHK script if anyone is curious:

Code: Select all

 ; Open Notepad++ on F4 in Lister window.
 #IfWinActive,ahk_class TLister
 f4::
    WinGetTitle,title
    StringLen,length,title
    StringMid,path,title,11,length-11
    WinClose
    Run,C:\Program Files (x86)\Notepad++\notepad++.exe %path%,
    WinActivate,ahk_class Notepad++
    return
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: F4 from Lister to Editor

Post by *Horst.Epp »

Hacker wrote: 2022-05-24, 13:37 UTC Horst.Epp,
Edit is not general usefull as it is not the same for different file formats.
Edit (F4) is always the same (F4 always calls the same editor) regardless of file format.
Roman
That is the problem, as I said.
You can't use Edit for image or office files for example.
For source files this is no problem and easy without adding scripts if the viewer plugin supports editing.
This is true for CudaLister and Syn2 (only x86).
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: F4 from Lister to Editor

Post by *Usher »

2matta
Actually you can use Alt+F3 for your needs, just define external editors (rater than viewers) associated with needed file extensions.
Andrzej P. Wozniak
Polish subforum moderator
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: F4 from Lister to Editor

Post by *Fla$her »

Why doesn't anyone mention AppLoader? :shock:
Overquoting is evil! 👎
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: F4 from Lister to Editor

Post by *Horst.Epp »

matta wrote: 2022-05-24, 13:56 UTC Exactly. Lister's F4 could use the standard TC handler for that.
That was the way I was using it with AutoHotKey - just ran the N++ I had assigned for F4 in TC.
I'm not willing to use AHK on current machine however.

AHK script if anyone is curious:

Code: Select all

 ; Open Notepad++ on F4 in Lister window.
 #IfWinActive,ahk_class TLister
 f4::
    WinGetTitle,title
    StringLen,length,title
    StringMid,path,title,11,length-11
    WinClose
    Run,C:\Program Files (x86)\Notepad++\notepad++.exe %path%,
    WinActivate,ahk_class Notepad++
    return
Your script doesn't work, it returns wrong path to the editor.
Here my working version which uses Akelpad, but this doesn't matter.

Code: Select all

 ; Open AkelPad on F4 in Lister window.
 #IfWinActive,ahk_class TLister
 f4::
    WinGetTitle,title
    left := InStr(title, "[") + 1
    right := InStr(title, "]") - left
    StringMid, path, title, left, right
    WinClose
    Run,C:\Tools\AkelPad\AkelPad.exe %path%,
    WinActivate,ahk_class Akelpad
    return
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: F4 from Lister to Editor

Post by *Hacker »

Horst.Epp,
That is the problem, as I said.
No, that is no problem for the people requesting this functionality.

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
matta
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-19, 12:47 UTC

Re: F4 from Lister to Editor

Post by *matta »

Horst.Epp wrote: 2022-05-24, 18:33 UTC Your script doesn't work, it returns wrong path to the editor.
Yes. Indeed, apparently the window title has changed since then. Was working at the time I was using it :) Thanks for the update.
User avatar
matta
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-19, 12:47 UTC

Re: F4 from Lister to Editor

Post by *matta »

Usher wrote: 2022-05-24, 18:02 UTC 2matta
Actually you can use Alt+F3 for your needs, just define external editors (rater than viewers) associated with needed file extensions.
Not the case. I want to use Lister in the first place (it is lite) and then edit if needed.
User avatar
matta
Junior Member
Junior Member
Posts: 5
Joined: 2022-05-19, 12:47 UTC

Re: F4 from Lister to Editor

Post by *matta »

Fla$her wrote: 2022-05-24, 18:31 UTC Why doesn't anyone mention AppLoader? :shock:
Looks promising, thanks!
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: MultiRenameTool to mark files that match filter

Post by *petermad »

Support++ It is fine with me that i can only launch the configured editor for F4 - that's what I would nedd 99% of the time.
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
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: F4 from lister to Editor

Post by *nsp »

petermad wrote: 2022-05-25, 23:27 UTC Support++ It is fine with me that i can only launch the configured editor for F4 - that's what I would nedd 99% of the time.
Support++ launching editor from viewer using F4 hotkey and adding menu entries where you can edit (F4) and even launch using internal association...
Post Reply