[BUG] Verical Edge Incorrect
CalvinsPal opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Description of the Issue
Vertical edge is displaying @ incorrect location
Steps To Reproduce
Define a position in the preferences->margin section->Vertical edge settings
Current Behavior
Vertical edge set to 80 is displaying @ 40
Expected Behavior
Display @ 80
Debug Information
Notepad++ v8.6.5 (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\Users\hauss\AppData\Roaming\Mozilla\Firefox\Profiles\s4emb6yl.default-release-1670182444794\gmp-widevinecdm\4.10.2710.0\LICENSE.txt"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 11 Home (64-bit
OS Version : 23H2
OS Build : 22631.3447
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)
Anything else?
The code that draws the vertical edge makes two assumptions:
-
every character is ASCII, i.e., 1 character = 1 byte. See how multi-byte Unicode text is also not aligned (by exceeding the limit):
-
the active font is monospaced, i.e., every character takes up the same amount of screen room. The font in the original screen capture looks to be proportional, i.e. variable-width (e.g. Arial)
Also discussed on the Community here: https://community.notepad-plus-plus.org/topic/25737
@rdipardo That makes sense. However, with the font face changed to a monospace font; the vertical edge only moves a few spaces/characters.
@CalvinsPal As a baseline, why don't you give "Courier New" font a try?