Code Editor Line number over 9999 not displayed correctly #13293

Closed
opened 2025-11-02 10:37:38 -06:00 by GiteaMirror · 11 comments
Owner

Originally created by @jonde99 on GitHub (Jul 16, 2024).

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

Originally created by @jonde99 on GitHub (Jul 16, 2024). ### Description ![image](https://github.com/user-attachments/assets/afee8d2f-5eac-4fd0-90d2-784c64545e2e) 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](https://github.com/user-attachments/assets/b700cb58-43d2-4558-bf3a-ee209e9b9bed) Edit Mode: ![image](https://github.com/user-attachments/assets/5422b69f-dff8-4fd1-beba-de9a5dacc4a7) ### Git Version 1.22.1 ### Operating System Redhat ### How are you running Gitea? docker. ### Database MySQL/MariaDB
GiteaMirror added the issue/confirmedtopic/uitype/bug labels 2025-11-02 10:37:38 -06:00
Author
Owner

@yp05327 commented on GitHub (Aug 13, 2024):

It seems that this is caused by the font?
image

@yp05327 commented on GitHub (Aug 13, 2024): It seems that this is caused by the font? <img width="952" alt="image" src="https://github.com/user-attachments/assets/66f770d0-a7e2-4a90-8157-928492878a59">
Author
Owner

@yp05327 commented on GitHub (Aug 13, 2024):

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

@yp05327 commented on GitHub (Aug 13, 2024): If you remove `Consolas` in `--fonts-monospace` it will be correct. ![image](https://github.com/user-attachments/assets/f69b0d4c-cbd1-421c-a8de-e0c3acb4b21b) ![image](https://github.com/user-attachments/assets/32e51c58-20e7-44d6-9c30-700d91fe0c17)
Author
Owner

@jonde99 commented on GitHub (Aug 13, 2024):

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 on GitHub (Aug 13, 2024): > If you remove `Consolas` in `--fonts-monospace` it will be correct. ![image](https://private-user-images.githubusercontent.com/18380374/357247380-f69b0d4c-cbd1-421c-a8de-e0c3acb4b21b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1MzcyMDAsIm5iZiI6MTcyMzUzNjkwMCwicGF0aCI6Ii8xODM4MDM3NC8zNTcyNDczODAtZjY5YjBkNGMtY2JkMS00MjFjLWE4ZGUtZTBjM2FjYjRiMjFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEzVDA4MTUwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4MGQ2MTcxMTQwZGY1OGVmNzEzYWI4YjI4NzgwOGI3NzdjYzkyMTYyMDdhN2Y3YTkxYmQ2Y2JmZmZjNGI5NTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hfyXnXA0M20EURwgJ6bp_mbWPQ2568OGCjhhezVHTD0) ![image](https://private-user-images.githubusercontent.com/18380374/357247490-32e51c58-20e7-44d6-9c30-700d91fe0c17.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM1MzcyMDAsIm5iZiI6MTcyMzUzNjkwMCwicGF0aCI6Ii8xODM4MDM3NC8zNTcyNDc0OTAtMzJlNTFjNTgtMjBlNy00NGQ2LTljMzAtNzAwZDkxZmUwYzE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEzVDA4MTUwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVhZTc5YTczZWRiMjM3MTY4OTI2M2Q4MDViZmY5OGY5YzY2MDYwMDJmMzFmNjdhZGRhMzMwZTUzMGU5MDU2NGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.RA5gRMcDylE4C0cI4CHNo1CVu3IrxzIqaZeTahscw6U) Thanks. I will ask our admin to remove this line.
Author
Owner

@jonde99 commented on GitHub (Aug 13, 2024):

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.

@jonde99 commented on GitHub (Aug 13, 2024): 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.
Author
Owner

@yp05327 commented on GitHub (Aug 13, 2024):

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 on GitHub (Aug 13, 2024): 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
Author
Owner

@yp05327 commented on GitHub (Aug 14, 2024):

In online demo, it works well.
image

@yp05327 commented on GitHub (Aug 14, 2024): In online demo, it works well. ![image](https://github.com/user-attachments/assets/aebae6ba-c26b-463c-ab0d-c441c25ae111)
Author
Owner

@palto42 commented on GitHub (Aug 15, 2024):

@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

@palto42 commented on GitHub (Aug 15, 2024): @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](https://github.com/user-attachments/assets/3a29cd41-9e85-4b90-a3ae-223c74ba277f) No issues in https://microsoft.github.io/monaco-editor/playground.html?source=v0.50.0#example-creating-the-editor-hello-world ![image](https://github.com/user-attachments/assets/f9e2af90-a2ed-4b5b-b66c-0add87f1e494)
Author
Owner

@lunny commented on GitHub (Aug 15, 2024):

I can confirm the problem.

图片

@lunny commented on GitHub (Aug 15, 2024): I can confirm the problem. ![图片](https://github.com/user-attachments/assets/387f4173-b7b3-44ab-a3ef-ad2c06363428)
Author
Owner

@yp05327 commented on GitHub (Aug 18, 2024):

@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.

@yp05327 commented on GitHub (Aug 18, 2024): > @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.
Author
Owner

@charles7668 commented on GitHub (Oct 17, 2024):

It seems the issue has been fixed by #31940.

@charles7668 commented on GitHub (Oct 17, 2024): It seems the issue has been fixed by #31940.
Author
Owner

@yp05327 commented on GitHub (Oct 17, 2024):

I tested it in the latest version, it is fixed!
image

I will close this issue.

@yp05327 commented on GitHub (Oct 17, 2024): I tested it in the latest version, it is fixed! ![image](https://github.com/user-attachments/assets/21604bc3-2030-40f9-bb3c-70f11464a4e0) I will close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13293