Skip to content

Gitea file view showing wrong amount of lines for both Unix and Windows/DOS line breaks but differently #27377

Open
@ell1e

Description

@ell1e

Description

(I was occasionally abrasive in some comments, I apologize. 🌸 )

Gitea shows a wrong amount of lines for both Unix and Windows/DOS line breaks in the web UI in both edit and code view, and in a very different and inconsistently wrong manner.

⚠️ Please note most Unix code editors get Windows/DOS line breaks wrong, including vim and the wc -l command, which counts line breaks characters and not lines, so it doesn't give correct line counts for Windows/DOX files. Get the correct lines displayed reliably: always check Windows/DOS \r\n line break files with notepad.exe on Windows, and always check Unix \n line break files with vim on Linux to show the correct amount of lines there. Or check with a hex editor what's really going on per file.

Gitea Version

1.22.0+dev-74-g4ab597f47

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

whatever is used on try.gitea.io

Operating System

whatever is used on try.gitea.io

How are you running Gitea?

it's on try.gitea.io

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions