forgejo/routers
Gusted 56b7478b25 [UI] Do not include trailing EOL character when counting lines
- Adjust the counting of the number of lines of a file to match the
amount of rendered lines. This simply means that a file with the content
of `a\n` will be shown as having `1 line` rather than `2 lines`. This
matches with the amount of lines that are being rendered (the last empty
line is never rendered) and matches more with the expecation of the
user (a trailing EOL is a technical detail).
- In the case there's no EOL, the reason why it was counting
'incorrectly' was to show if there was a trailing EOL or not, but now
text is shown to tell the user this.
- Integration test added.
- Resolves Codeberg/Community#1612

(cherry picked from commit 5cf976739c)
2024-08-06 12:24:38 +00:00
..
api [API] Add error messages to dispatch API 2024-08-01 08:23:59 +00:00
common feat(api): implement branch/commit comparison API (#30349) 2024-04-21 11:58:18 +02:00
install Fix wrong error highlighting on install page (#4063) 2024-06-11 19:05:05 +00:00
private enable linter testifylint on v8 (#4573) 2024-07-30 19:41:27 +00:00
utils [PORT] drop utils.IsExternalURL (and expand IsRiskyRedirectURL tests) (#3167) 2024-04-15 13:03:08 +00:00
web [UI] Do not include trailing EOL character when counting lines 2024-08-06 12:24:38 +00:00
init.go s/Gitea/Forgejo in various log messages and comments 2024-04-21 21:26:15 +05:00