Wrapping long lines in code views #754

Closed
opened 2025-11-02 03:35:13 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @silverwind on GitHub (May 28, 2017).

Currently, Gitea does not wrap long lines of code, making it harder to look at code and diffs that contains lines that extend beyond the screen width.

Is there a general interest in having long lines automatically wrapped? It's a simple CSS tweak (similar to what I've done here for GitHub):

Before:

After:

This might not work too well on small screens, where I think it might be better to not wrap those lines (horizontal scrolling is easier on touch).

Originally created by @silverwind on GitHub (May 28, 2017). Currently, Gitea does not wrap long lines of code, making it harder to look at code and diffs that contains lines that extend beyond the screen width. Is there a general interest in having long lines automatically wrapped? It's a simple CSS tweak (similar to what I've done [here](https://github.com/StylishThemes/GitHub-code-wrap/blob/master/github-code-wrap.css) for GitHub): Before: <img width="1154" src="https://cloud.githubusercontent.com/assets/115237/26529488/dda99758-43c0-11e7-96d4-2142d6dca7c1.png"> After: <img width="1152" src="https://cloud.githubusercontent.com/assets/115237/26529491/f0d8229a-43c0-11e7-86ff-decec95fec61.png"> This might not work too well on small screens, where I think it might be better to not wrap those lines (horizontal scrolling is easier on touch).
GiteaMirror added the topic/uitype/enhancement labels 2025-11-02 03:35:13 -06:00
Author
Owner

@lunny commented on GitHub (May 29, 2017):

@silverwind please send a PR.

@lunny commented on GitHub (May 29, 2017): @silverwind please send a PR.
Author
Owner

@appleboy commented on GitHub (Jun 1, 2017):

fixed by https://github.com/go-gitea/gitea/pull/1845

@appleboy commented on GitHub (Jun 1, 2017): fixed by https://github.com/go-gitea/gitea/pull/1845
Author
Owner

@silverwind commented on GitHub (Jun 1, 2017):

Actually, this one isn't fixed yet. Can you reopen please?

@silverwind commented on GitHub (Jun 1, 2017): Actually, this one isn't fixed yet. Can you reopen please?
Author
Owner

@mlthlschr commented on GitHub (Jun 18, 2020):

would be great if this could be enabled in normal code views as well (maybe via toggle or config setting). currently working with .Rmd files which contain quite long lines sometimes.

@mlthlschr commented on GitHub (Jun 18, 2020): would be great if this could be enabled in normal code views as well (maybe via toggle or config setting). currently working with `.Rmd` files which contain quite long lines sometimes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#754