Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting in arc-green Colors all Identifiers in Orange #22348

Closed
julmb opened this issue Jan 5, 2023 · 8 comments · Fixed by #23174
Closed

Syntax Highlighting in arc-green Colors all Identifiers in Orange #22348

julmb opened this issue Jan 5, 2023 · 8 comments · Fixed by #23174
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@julmb
Copy link

julmb commented Jan 5, 2023

Description

From 1.17.1 to 1.17.2, syntax highlighting when viewing files in the arc-green theme changed in such a way that many parts of the code are assigned the same orange color. This is inconsistent with both the gitea theme and the way arc-green behaves when editing files.

For instance, in screenshot [1], regular identifiers use the regular text color, and special identifiers like function names and built-in types get a special color. In screenshot [2], all of these identifiers get the same orange color. In all of the code files I have looked at, the majority of the text was orange rather than the regular gray text color. This does not happen when editing files [3]. The light theme also uses regular text color for regular identifiers and special colors for special identifiers [4].

Syntax highlighting when viewing files in the arc-green theme seems to work the same way in 1.18.0 as it does in 1.17.2

Screenshots

[1] 1.17.1 - arc-green - view file
image
[2] 1.17.2 - arc-green - view file
image
[3] 1.17.2 - arc-green - edit file
image
[4] 1.17.2 - gitea - view file
image

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

No response

Browser Version

Chromium Version 108.0.5359.124 (Official Build) Arch Linux (64-bit)

@julmb julmb added type/bug topic/ui Change the appearance of the Gitea UI labels Jan 5, 2023
@silverwind
Copy link
Member

Likely a C++ specific issue. Can you push an example to https://try.gitea.io/?

@wxiaoguang
Copy link
Contributor

https://try.gitea.io/wxiaoguang/test/src/branch/master/test.cpp

kt and n use the same color in arc-green.

image

@julmb
Copy link
Author

julmb commented Jan 9, 2023

Likely a C++ specific issue. Can you push an example to https://try.gitea.io/?

From my experiments, it happens in at least C++, Java, C#, Haskell, and Python. In fact, so far, I have not seen a language where it does not happen.

I have uploaded some examples to try.gitea.io:
https://try.gitea.io/jules/highlighting-test/src/branch/main/main.cpp
https://try.gitea.io/jules/highlighting-test/src/branch/main/Main.hs
https://try.gitea.io/jules/highlighting-test/src/branch/main/main.java
https://try.gitea.io/jules/highlighting-test/src/branch/main/main.py

All of these have the distinct "everything is orange" look, where all identifiers are assigned the same color.

@lunny lunny added this to the 1.19.0 milestone Feb 15, 2023
@delvh delvh added the outdated/backport/v1.19 This PR should be backported to Gitea 1.19 label Feb 22, 2023
@delvh delvh modified the milestones: 1.19.0, 1.20.0 Feb 22, 2023
@lunny lunny modified the milestones: 1.20.0, 1.19.0 Feb 23, 2023
@lunny lunny removed the outdated/backport/v1.19 This PR should be backported to Gitea 1.19 label Feb 23, 2023
@wxiaoguang
Copy link
Contributor

Fix broken highlight styles #23148

@stuzer05
Copy link

stuzer05 commented Mar 8, 2023

@lunny @delvh Should this issue be in 1.20.0 milestone, not in 1.19.0? The only not closed pr referencing this issue has 1.20.0 milestone and here's no backport flair anymore

@lunny
Copy link
Member

lunny commented Mar 8, 2023

@lunny @delvh Should this issue be in 1.20.0 milestone, not in 1.19.0? The only not closed pr referencing this issue has 1.20.0 milestone and here's no backport flair anymore

@wxiaoguang said he will take this issue after 1.19.0 or 1.19.1. So I think this should not prevent to release 1.19.0

@wxiaoguang
Copy link
Contributor

I have proposed #23174 , @silverwind might want to do some changes (ping about progress).

ps: it doesn't need to block 1.19.0 release. If 1.19.0 is ready, it could be released and backport the fix later.

@silverwind
Copy link
Member

Yeah I will have look shortly. Agree it's not blocking 1.19 because IIRC the issue is present on 1.18 as well.

techknowlogick pushed a commit that referenced this issue Mar 10, 2023
The CSS styles in Gitea themes are out-of-sync of Chroma's styles.

This PR introduces a `chroma-style-diff.go` tool to compare the diff.
The missing CSS styles have been added manually. They are left as empty
to reduce arguments because there was no color for them before.

And this PR fixes #22348, with just 2 lines changed: `.chroma .kt & .n`,
these colors are taken from GitHub.

It's good enough for #22348


![image](https://user-images.githubusercontent.com/2114189/221551941-0d27d11d-e71e-498f-8e88-92b558fe4a18.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 10, 2023
The CSS styles in Gitea themes are out-of-sync of Chroma's styles.

This PR introduces a `chroma-style-diff.go` tool to compare the diff.
The missing CSS styles have been added manually. They are left as empty
to reduce arguments because there was no color for them before.

And this PR fixes go-gitea#22348, with just 2 lines changed: `.chroma .kt & .n`,
these colors are taken from GitHub.

It's good enough for go-gitea#22348


![image](https://user-images.githubusercontent.com/2114189/221551941-0d27d11d-e71e-498f-8e88-92b558fe4a18.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
lunny pushed a commit that referenced this issue Mar 10, 2023
Backport #23174

The CSS styles in Gitea themes are out-of-sync of Chroma's styles.

This PR introduces a `chroma-style-diff.go` tool to compare the diff.
The missing CSS styles have been added manually. They are left as empty
to reduce arguments because there was no color for them before.

And this PR fixes #22348, with just 2 lines changed: `.chroma .kt & .n`,
these colors are taken from GitHub.

It's good enough for #22348


![image](https://user-images.githubusercontent.com/2114189/221551941-0d27d11d-e71e-498f-8e88-92b558fe4a18.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants