Line numbers in LISTER

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ironhard
Junior Member
Junior Member
Posts: 2
Joined: 2003-02-14, 17:23 UTC

Line numbers in LISTER

Post by *ironhard »

I think that it would be a good and useful idea to have line numbers appreared in the LISTER.

The way I do it now, is thru COMPARE BY CONTENT.

Any suggestions or tweaks on that?

Thanks in advance.

Nick
User avatar
ben hub
Member
Member
Posts: 132
Joined: 2003-02-06, 21:47 UTC
Location: Madagascar

Post by *ben hub »

have a look at fabulous SCHMaster's plugin SynUs (ex-BorlandViewer)
and read the thread about it : http://ghisler.ch/board/viewtopic.php?t=44

SynUs can show line numbers... and so much more !!!
Benoît
# 4081
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Lister doesn't show line numbers because it would have to read the whole file to determine what line it is on (eg when you search in lister or drag the scroll bar) and that would be slow compared to as it is now, just reading the portion of the file the Lister is at.

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
André Martin
Senior Member
Senior Member
Posts: 245
Joined: 2003-02-05, 15:46 UTC
Location: Dresden, Germany

Post by *André Martin »

What about a setting in the IniFile:

ShowLineNumbersOnlyWhenFilesIsSmallerThen: 100000
Browse the web with the HTTP SmartBrowserPlugin
Check your mails with the POP3/SMTP EmailPlugin!
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

ShowLineNumbersOnlyWhenFilesIsSmallerThen: 100000

The "s" and "e" might confuse some. :P

Roman
User avatar
André Martin
Senior Member
Senior Member
Posts: 245
Joined: 2003-02-05, 15:46 UTC
Location: Dresden, Germany

Post by *André Martin »

Oh yeah - this happens if you type faster thAn you think... and if English is not your mother tongue!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The current implementation of Lister is optimized to show files of ANY size (whatever is supported by the file system, up to 2^64 bytes) almost instantaneously. To show line numbers, TC would have to read the whole file into memory (or at least count the line breaks) from the beginning of the file up to the current location. You can see what this means if you try to open a several 100 MB log file in a text editor.

Therefore the display of line numbers will be left to Lister plugins.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

... and therefore Andre suggested a size limit....

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
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, but this would mean that I would have to program two completely different lister engines, one which works as it is now, and the other which is used only for small files and loads everything into memory. At the moment, I don't have the time to do this - and it can be done very well with lister plugins! So why re-invent the wheel?
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

How about a key in Lister to (re)load the file and show the line numbers? This way the user could decide when to show and when not. Would this require a new engine, too?

TIA
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
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately yes. But what you suggest will be possible with plugins in TC 5.51.
Author of Total Commander
https://www.ghisler.com
ironhard
Junior Member
Junior Member
Posts: 2
Joined: 2003-02-14, 17:23 UTC

thanks

Post by *ironhard »

Thanks guys.
I will be checking out the plugins...

Nick
Post Reply