Skip to content

Editorconfig not respected in PR Conversation view #24991

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

Open
silverwind opened this issue May 29, 2023 · 1 comment
Open

Editorconfig not respected in PR Conversation view #24991

silverwind opened this issue May 29, 2023 · 1 comment
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@silverwind
Copy link
Member

silverwind commented May 29, 2023

Description

Tab size preference from .editorconfig is not working in the conversation tab:

https://try.gitea.io/silverwind/symlink-test/pulls/11

image

It is working in the Files tab:

https://try.gitea.io/silverwind/symlink-test/pulls/11/files

image

I traced it to templates/repo/issue/view_content/comments.tmpl line 521:

{{TabSizeClass $.Editorconfig $file.Name}}

$.Editorconfig is nil here, so TabSizeClass incorrectly returns the default tab size of 8. Maybe someone familiar around these parts sees the fix, for me it at least is not obvious.

Gitea Version

main

Can you reproduce the bug on the Gitea demo site?

Yes

@silverwind silverwind added type/bug topic/ui Change the appearance of the Gitea UI labels May 29, 2023
@wxiaoguang
Copy link
Contributor

The Editorconfig is injected by a middleware SetEditorconfigIfExists. I guess the middleware is not correctly called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

No branches or pull requests

2 participants