notepad-plus-plus / notepad-plus-plus

Notepad++ official repository

Home Page:https://notepad-plus-plus.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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?

2024-05-03 08_19_45-

The code that draws the vertical edge makes two assumptions:

  1. every character is ASCII, i.e., 1 character = 1 byte. See how multi-byte Unicode text is also not aligned (by exceeding the limit):

    color-column-unicode
  2. 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.

2024-05-03 16_14_07-Style Configurator

@CalvinsPal As a baseline, why don't you give "Courier New" font a try?