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

Glitch on colors #1

Open
Masum-Osman opened this issue Dec 20, 2024 · 0 comments
Open

Glitch on colors #1

Masum-Osman opened this issue Dec 20, 2024 · 0 comments
Assignees

Comments

@Masum-Osman
Copy link
Owner

Description

Noticed that the PrettyPrint package sometimes has a glitch with the color coding. Specifically, it occasionally breaks the color code for "key" and "value" in the JSON output printed to the terminal.

Steps to Reproduce

Use the PrettyPrint package to print a Go struct as indented JSON in the terminal.
Observe the color output for keys and values.
Expected Behavior
Keys should consistently be colored cyan, and values should be consistently colored yellow.

Actual Behavior

Occasionally, the color coding for keys and values is broken, resulting in incorrect or inconsistent colors.

Additional Information

The issue appears sporadically and is not consistent.
It might be related to the handling of quotes and special characters in the JSON string.
Proposed Solution
Investigate the logic for determining when to apply color coding, especially around quotes and special characters. Ensure that the state (e.g., inString, isKey, insideArray) is correctly managed throughout the process.

@Masum-Osman Masum-Osman self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant