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

[BUG] :debug faces does not work from inside a command. #5262

Open
Screwtapello opened this issue Dec 14, 2024 · 1 comment
Open

[BUG] :debug faces does not work from inside a command. #5262

Screwtapello opened this issue Dec 14, 2024 · 1 comment
Labels

Comments

@Screwtapello
Copy link
Contributor

Version of Kakoune

v2024.05.18-188-g9c458c50

Reproducer

kak -n -e 'def a "buffer *debug*; debug faces"; a'

Outcome

The *debug* buffer contains:

Faces:

Expectations

The *debug* buffer contains:

Faces:
 * Default: default,default,default
 * PrimarySelection: white,blue,default
 * SecondarySelection: black,blue,default
 * PrimaryCursor: black,white,default
 * SecondaryCursor: black,white,default
 * PrimaryCursorEol: black,cyan,default
 * SecondaryCursorEol: black,cyan,default
 ...

Additional information

Just running kak -n -e 'buffer *debug*; debug faces' works fine, it's wrapping it in a command that causes the problem.

git bisect indicates 1c71fc0 as the cause, "Add local scope to user commands", from 2024-04-29. debug faces calls context.faces().flatten_faces() to get the list of faces to write, which I guess is empty inside a local context rather than inheriting from the parent context.

@Screwtapello
Copy link
Contributor Author

As for why somebody might want to call debug faces from a command, I use it to quickly preview all the faces in a colorscheme:

https://discuss.kakoune.com/t/display-all-faces-in-the-current-color-scheme/1178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant