go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.08k stars 5.41k forks source link

Code Editor Line number over 9999 not displayed correctly #31642

Open jonde99 opened 1 month ago

jonde99 commented 1 month ago

Description

image

Any file over 10000 lines displays the line numbers beyond 9999 incorrectly in the online editor.

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Review mode: image

Edit Mode: image

Git Version

1.22.1

Operating System

Redhat

How are you running Gitea?

docker.

Database

MySQL/MariaDB

yp05327 commented 1 month ago

It seems that this is caused by the font?

image
yp05327 commented 1 month ago

If you remove Consolas in --fonts-monospace it will be correct. image image

jonde99 commented 1 month ago

If you remove Consolas in --fonts-monospace it will be correct. image image

Thanks. I will ask our admin to remove this line.

jonde99 commented 1 month ago

I played with this option, and it doesn't really fix it, it just delays the problem until there are 6 digits in the line number. The correct solution would be to allow the column to expand, but I cannot figure out where that is done.

yp05327 commented 1 month ago

I didn’t try 6 digits…. Maybe we need to check it first in https://microsoft.github.io/monaco-editor/playground.html?source=v0.50.0#example-creating-the-editor-hello-world

yp05327 commented 4 weeks ago

In online demo, it works well. image

palto42 commented 4 weeks ago

@yp05327

In online demo, it works well.

Are you sure you tried the editor view an not just the text preview? I also tried the demo server and can confirm that I face the same issue as on my local Gitea instance. https://demo.gitea.com/palto42/big_text/_edit/main/dummy_text_file.txt

image

No issues in https://microsoft.github.io/monaco-editor/playground.html?source=v0.50.0#example-creating-the-editor-hello-world

image

lunny commented 4 weeks ago

I can confirm the problem.

图片

yp05327 commented 3 weeks ago

@yp05327

In online demo, it works well.

Are you sure you tried the editor view an not just the text preview? I also tried the demo server and can confirm that I face the same issue as on my local Gitea instance. https://demo.gitea.com/palto42/big_text/_edit/main/dummy_text_file.txt

I mean it works well in monaco editor playground, but not Gitea.