How do I see all the line numbers in a large document?

Posted by ericp on 2007-10-26 09:30
OS: All / Any | Product: Komodo | tags: large documents

When I load a large document in Komodo, I only see the last four digits of each
line number in the line number margin. How can I tell whether I'm on line 198065
or 238065 of a 400,000-line document?


While Komodo is designed to work with smaller documents that people create,
need to understand, and manipulate, and these files rarely exceed 10,000
lines in length, sometimes you need to load larger files. A common case is
stepping into a document containing generated code while debugging.

When Komodo loads a document, it counts the number of lines, and determines how
wide the line-number margin should be based on a document that can be twice
as long. Since the width is given in pixels, not characters, the number of
digits you'll see in the margin varies depending on your system.

Also, this code is only run when a buffer is loaded, and when you change the
properties, either global or local, to show line numbers. If you load a
small document and read in a few hundred thousand lines the margin won't
change. To stop truncating the line-numbers, you can either hide
line-numbers, and redisplay them, or use this macro:

var scimoz = ko.views.manager.currentView.scimoz;
var padding = 5;
var textWidth = scimoz.textWidth(0, "" + scimoz.lineCount);
scimoz.setMarginWidthN(0, textWidth + padding);