Lister - small feature request - line and char position

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
jdmarch
Member
Member
Posts: 161
Joined: 2003-03-12, 02:34 UTC
Location: Austin, Texas, USA

Lister - small feature request - line and char position

Post by *jdmarch »

I understand that Lister is not supposed to be full-featured, and I do regularly use View64, or my favorite editor, but I would appreciate it if Lister would show somewhere (maybe in the context menu?) the line and char position of the first selected character.

Usually I simply want to know the number of lines in a file, and sometimes the width of the longest lines.

Thanks,
Jonathan
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Re: Lister - small feature request - line and char position

Post by *djk »

jdmarch wrote:I would appreciate it if Lister would show somewhere (maybe in the context menu?) the line and char position of the first selected character.
Have you tried any lister plugins? For example: hpg_ed.wlx? It does it.
http://www.ghisler.ch/board/viewtopic.php?t=1212
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I would appreciate it if Lister would show somewhere (maybe in the context menu?) the line and char position of the first selected character.
Lister itself cannot do this, because it does not even know this! Why? To know the current line, it would have to read the whole file from the beginning to the current position, and count the line breaks. But lister only reads a small part of the file around the current position. Otherwise it couldn't show very large files very quickly. Try loading a 1 GB file with hpg_ed - tell me how many minutes (or hours?) you wait. :)
Author of Total Commander
https://www.ghisler.com
User avatar
jdmarch
Member
Member
Posts: 161
Joined: 2003-03-12, 02:34 UTC
Location: Austin, Texas, USA

Post by *jdmarch »

To know the current line, it would have to read the whole file from the beginning to the current position, and count the line breaks.
Often (usually?) the current position is reached by scrolling from the beginning of the file. When this is true, Lister could display the desired information, yes?

Thanks,
Jonathan
Jonas
Senior Member
Senior Member
Posts: 325
Joined: 2003-05-27, 16:59 UTC
Location: Germany
Contact:

Post by *Jonas »

Normaly, the files where you need the current position of the curser is sourcecode. And source-files normaly are < 1GB ;)
So I'm still voting for an optional curser (Hotkey 'c' or something) If visible, the curserkeys don't controll scrolling anymore but changing the position of the curser and a statusbar appears with information about line and col. (and maybe ASCII-code in dec/hex of the char under the curser)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Why not use the hpg_ed lister plugin, as I suggested? It handles most programming languages, and even supports syntax highlighting!
Author of Total Commander
https://www.ghisler.com
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

ghisler(Author) wrote:Why not use the hpg_ed lister plugin, as I suggested?
Christian, I suggested that !!! :-)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You are right, sorry! I just referred to it with 1 GB files. :)
Author of Total Commander
https://www.ghisler.com
User avatar
jdmarch
Member
Member
Posts: 161
Joined: 2003-03-12, 02:34 UTC
Location: Austin, Texas, USA

Post by *jdmarch »

OK, trying to use HPG_ED. I'm sorry to be dense, but I'm having installation problems. I unpacked the HPG_ED files to my Total Cmd directory Y:\util\wincmd\, and (since I'm using TC 5.50) added these 2 lines to wincmd.ini:
[ListerPlugins]
1=Y:\util\wincmd\hpg_ed.wlx

But when I press F3 in TotCmd, it seems that the default lister is still being used for all file extensions. The readme says that HPG_ED will be used "for an associated file" but gives no indication how such an association should be made. The internal viewer configuration Associated Files dialog only permits association with executables, not with WLX files. I restarted TC, no help.

Suggestions? Thanks,
Jonathan
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

jdmarch wrote: The readme says that HPG_ED will be used "for an associated file" but gives no indication how such an association should be made. The internal viewer configuration Associated Files dialog only permits association with executables, not with WLX files. I restarted TC, no help.
As I remember it's by default associated with most files it supports (among others: .txt files) - What type of file do you try to view? What extension has it?
The plugin has got its ini file - hpg_ed.ini in the directory where wincmd.ini is stored.
Have you checked the [lister plugins] section isn't doubled in the wincmd.ini file?
You can also change the associations from the configuration option in... hpg_ed :-) (but you must see it first)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

SynUs can also be useful to you jdmarch: http://totalcommander.free.fr/
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
jdmarch
Member
Member
Posts: 161
Joined: 2003-03-12, 02:34 UTC
Location: Austin, Texas, USA

Post by *jdmarch »

What type of file do you try to view? What extension has it?
I tried with TXT, PAS, and CPP.
The plugin has got its ini file - hpg_ed.ini in the directory where wincmd.ini is stored
Not there. I think the plugin has never been recognized by Lister.

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

Post by *Hacker »

For the start, you should unpack it to a separate subdir, like wincmd\Lister Plugins\HPG_ED so your files don't mix up. Then you should install it by starting the Lister (by viewing any file), then Options - Configure - LS-Plugins.

Then we can take a look at why it doesn't work. (BTW: Tried pressing 4 when viewing a supported file?)

HTH
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
jdmarch
Member
Member
Posts: 161
Joined: 2003-03-12, 02:34 UTC
Location: Austin, Texas, USA

Post by *jdmarch »

HPG_ED is working for me now. The problem was an undocumented (and apparently little considered) requirement of section [ListerPlugins]: The plugin lines must be numbered with consecutive integers beginning with 0. (The lines need not be physically held in this order, but no integers can be missing in the section.) Following the example in the HPG_ED, I had used number 1, so TC never saw this plugin line, since there was no line 0.

I was using TC 5.50, which required hand-editing of this section. Now that 5.51 automates this process, it should be less of a problem. Nonetheless, I think it should be documented. I also that this is a small bug in TC, as it is normal for missing sequence numbers in registry or INI sections (e.g. in MRU lists) to be handled smoothly.

Thanks,
Jonathan
Post Reply