Platform: Notepad++ 7.7.1 on Windows 10
In the Document Map and at the highest 3 levels of zoom out (Doc Map is just a zoomed out view) the alignment of text containing tabs is no longer correct. Some rows display an additional tab with no obvious pattern.
See attached image - the orange datatypes in this SQL script are all aligned with 4 character tabs. There are no other characters between the white field names and datatypes, just tabs.
This could be a loss-of-precision or rounding to integer issue. One factor that could influence this is whether the view is using GDI (technology=0, integer widths) or DirectWrite (technology=1, floating point widths).
You should attach the file that showed the issue.
I think it's mostly happens on GDI.
The screenshot tested this file with DejaVu Sans Mono 11pt at 100%.
https://github.com/zufuliu/notepad2/blob/master/src/Notepad2.rc
Happens on D2D too when extremely zoomed out (<= 22%).
Last edit: Zufu Liu 2019-07-03
Thanks for confirming Zufu Liu. Attaching a sample SQL script.
Did consider if it was some sort of rounding or odd/even thing as on average half the lines are correct and half not.
This is caused by the minimum tab width which is set to 2 pixels. This ensures that tabs are always visible.
For a document map where there is no need to see every detail, this value could be made changeable by the application with a new API.
You can experiment by changing the value assigned to tabWidthMinimumPixels in the EditView constructor.
Set tabWidthMinimumPixels to 1 fixed the problem.
A proposed SCI_SETTABMINIMUMWIDTH API change set is attached. Includes a generic SetAppearance method.
Is this bug also affect printing?
Its possible but printers are commonly higher resolution than screens so less likely.
For the change to progress there needs to be confirmation that it works correctly in the target application.
It works. I found it only need to set when font size is smaller than 3.5pt.
https://github.com/zufuliu/notepad2/commit/82c40f3252509d26a409293d69d3b54a4db8155e
The bug is against the document map in Notepad++, not Notepad2. What I want here is assurance that this change will actually be useful in the context of document maps (sometimes called mini-maps) and in particular, the patch is correct for the document map in Notepad++.
I don't know where to add SCI_SETTABMINIMUMWIDTH call in Notepad++, but build SciLexer.dll with hard-coded 1 for tabWidthMinimumPixels works.
Committed new API as [ed73f7], [e6efe0].
Related
Commit: [e6efe0]
Commit: [ed73f7]
Committed new API as [ed73f7], [e6efe0].
Related
Commit: [e6efe0]
Commit: [ed73f7]