Project

General

Profile

Actions

Bug #30

closed

Line number margin width should be set automatically on growing/shrinking lines

Added by Wil van Antwerpen almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
03/27/2017
Due date:
% Done:

0%

Estimated time:

Description

The line number margin width is set automatically.
However it is only determined once. As a result when your required width changes, it does not adapt the width with it.

The way the automatic margin width logic currently works is this:

If you enable line margins when the document is empty it will set a default margin of based on the width of this string “_99999”. This is currently what you will see if you start the hammer2 (maybe also hammer3) as it sets the margin before the document is loaded.

If you enable the margin once you have a document loaded (eg. toggle using the new settings dialog) then it will set the margin width depending on how many lines are stored in your document.
So if you have a file with 200 lines of code it will determine the line count and set the width for “_200”.
If your document has 6350 lines then it will set a width for “_6350” lines etc..
If your document has 2226350 lines then it will set a width for “_2226350” lines etc..
Note that the line numbering itself is automatic.. we do not have to do anything for that, the control does this automatically

So we have to add margin width detection logic in the LineChanged event.

Actions

Also available in: Atom PDF